diff options
author | dim <dim@FreeBSD.org> | 2013-10-06 16:12:45 +0000 |
---|---|---|
committer | dim <dim@FreeBSD.org> | 2013-10-06 16:12:45 +0000 |
commit | d15691c08b59b5c5c79db30b4bb79522e27f5965 (patch) | |
tree | 069bc183f991786d4b95847722382d6822e24b3c /contrib/llvm/lib | |
parent | 71eaa9969e6656920856b321be3430c54dea31fc (diff) | |
download | FreeBSD-src-d15691c08b59b5c5c79db30b4bb79522e27f5965.zip FreeBSD-src-d15691c08b59b5c5c79db30b4bb79522e27f5965.tar.gz |
Pull in r192064 from upstream llvm trunk:
X86: Don't fold spills into SSE operations if the stack is unaligned.
Regalloc can emit unaligned spills nowadays, but we can't fold the
spills into SSE ops if we can't guarantee alignment. PR12250.
This fixes unaligned SSE accesses (leading to a SIGBUS) which could
occur in the ffmpeg ports.
Approved by: re (kib)
Reported by: tijl
MFC after: 3 days
Diffstat (limited to 'contrib/llvm/lib')
-rw-r--r-- | contrib/llvm/lib/Target/X86/X86InstrInfo.cpp | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/contrib/llvm/lib/Target/X86/X86InstrInfo.cpp b/contrib/llvm/lib/Target/X86/X86InstrInfo.cpp index 7c0423f..423bd44 100644 --- a/contrib/llvm/lib/Target/X86/X86InstrInfo.cpp +++ b/contrib/llvm/lib/Target/X86/X86InstrInfo.cpp @@ -3881,6 +3881,10 @@ MachineInstr* X86InstrInfo::foldMemoryOperandImpl(MachineFunction &MF, const MachineFrameInfo *MFI = MF.getFrameInfo(); unsigned Size = MFI->getObjectSize(FrameIndex); unsigned Alignment = MFI->getObjectAlignment(FrameIndex); + // If the function stack isn't realigned we don't want to fold instructions + // that need increased alignment. + if (!RI.needsStackRealignment(MF)) + Alignment = std::min(Alignment, TM.getFrameLowering()->getStackAlignment()); if (Ops.size() == 2 && Ops[0] == 0 && Ops[1] == 1) { unsigned NewOpc = 0; unsigned RCSize = 0; |