diff options
author | dim <dim@FreeBSD.org> | 2013-02-15 23:12:58 +0000 |
---|---|---|
committer | dim <dim@FreeBSD.org> | 2013-02-15 23:12:58 +0000 |
commit | ff49b0d5878fa588874022dc953f5d74e1056213 (patch) | |
tree | 6b94b8e4909b082a6070e389b63947decb6c68f8 /contrib/llvm/lib/Target/X86/X86SelectionDAGInfo.cpp | |
parent | 62a21e98adbed0abb1b8dc22cdae0e111277b466 (diff) | |
download | FreeBSD-src-ff49b0d5878fa588874022dc953f5d74e1056213.zip FreeBSD-src-ff49b0d5878fa588874022dc953f5d74e1056213.tar.gz |
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
Diffstat (limited to 'contrib/llvm/lib/Target/X86/X86SelectionDAGInfo.cpp')
-rw-r--r-- | contrib/llvm/lib/Target/X86/X86SelectionDAGInfo.cpp | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/contrib/llvm/lib/Target/X86/X86SelectionDAGInfo.cpp b/contrib/llvm/lib/Target/X86/X86SelectionDAGInfo.cpp index 723e50c..efc3490 100644 --- a/contrib/llvm/lib/Target/X86/X86SelectionDAGInfo.cpp +++ b/contrib/llvm/lib/Target/X86/X86SelectionDAGInfo.cpp @@ -202,6 +202,14 @@ X86SelectionDAGInfo::EmitTargetCodeForMemcpy(SelectionDAG &DAG, DebugLoc dl, 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; |