Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 15 Feb 2013 23:12:58 +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: r246858 - head/contrib/llvm/lib/Target/X86
Message-ID:  <201302152312.r1FNCw4D038809@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: dim
Date: Fri Feb 15 23:12:58 2013
New Revision: 246858
URL: http://svnweb.freebsd.org/changeset/base/246858

Log:
  Pull in r175057 from upstream llvm trunk:
  
    X86: Disable generation of rep;movsl when %esi is used as a base pointer.
  
    This happens when there is both stack realignment and a dynamic alloca in the
    function. If we overwrite %esi (rep;movsl uses fixed registers) we'll lose the
    base pointer and the next register spill will write into oblivion.
  
    Fixes PR15249 and unbreaks firefox on i386/freebsd. Mozilla uses dynamic allocas
    and freebsd a 4 byte stack alignment.
  
  MFC after:	1 week

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

Modified: head/contrib/llvm/lib/Target/X86/X86SelectionDAGInfo.cpp
==============================================================================
--- head/contrib/llvm/lib/Target/X86/X86SelectionDAGInfo.cpp	Fri Feb 15 23:12:35 2013	(r246857)
+++ head/contrib/llvm/lib/Target/X86/X86SelectionDAGInfo.cpp	Fri Feb 15 23:12:58 2013	(r246858)
@@ -202,6 +202,14 @@ X86SelectionDAGInfo::EmitTargetCodeForMe
       SrcPtrInfo.getAddrSpace() >= 256)
     return SDValue();
 
+  // ESI might be used as a base pointer, in that case we can't simply overwrite
+  // the register.  Fall back to generic code.
+  const X86RegisterInfo *TRI =
+      static_cast<const X86RegisterInfo *>(DAG.getTarget().getRegisterInfo());
+  if (TRI->hasBasePointer(DAG.getMachineFunction()) &&
+      TRI->getBaseRegister() == X86::ESI)
+    return SDValue();
+
   MVT AVT;
   if (Align & 1)
     AVT = MVT::i8;



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