Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 6 Oct 2013 16:12:45 +0000 (UTC)
From:      Dimitry Andric <dim@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r256090 - head/contrib/llvm/lib/Target/X86
Message-ID:  <201310061612.r96GCjVr048276@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: dim
Date: Sun Oct  6 16:12:45 2013
New Revision: 256090
URL: http://svnweb.freebsd.org/changeset/base/256090

Log:
  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

Modified:
  head/contrib/llvm/lib/Target/X86/X86InstrInfo.cpp

Modified: head/contrib/llvm/lib/Target/X86/X86InstrInfo.cpp
==============================================================================
--- head/contrib/llvm/lib/Target/X86/X86InstrInfo.cpp	Sun Oct  6 15:59:06 2013	(r256089)
+++ head/contrib/llvm/lib/Target/X86/X86InstrInfo.cpp	Sun Oct  6 16:12:45 2013	(r256090)
@@ -3881,6 +3881,10 @@ MachineInstr* X86InstrInfo::foldMemoryOp
   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;



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201310061612.r96GCjVr048276>