summaryrefslogtreecommitdiffstats
path: root/contrib/llvm
diff options
context:
space:
mode:
authordim <dim@FreeBSD.org>2013-10-06 16:12:45 +0000
committerdim <dim@FreeBSD.org>2013-10-06 16:12:45 +0000
commitd15691c08b59b5c5c79db30b4bb79522e27f5965 (patch)
tree069bc183f991786d4b95847722382d6822e24b3c /contrib/llvm
parent71eaa9969e6656920856b321be3430c54dea31fc (diff)
downloadFreeBSD-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')
-rw-r--r--contrib/llvm/lib/Target/X86/X86InstrInfo.cpp4
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;
OpenPOWER on IntegriCloud