[llvm-commits] [llvm] r114402 - /llvm/trunk/lib/Target/X86/X86SelectionDAGInfo.cpp
Chris Lattner
sabre at nondot.org
Mon Sep 20 22:43:35 PDT 2010
Author: lattner
Date: Tue Sep 21 00:43:34 2010
New Revision: 114402
URL: http://llvm.org/viewvc/llvm-project?rev=114402&view=rev
Log:
Fix a bug where the x86 backend would lower memcpy/memset of segment relative operations
into non-segment-relative copies.
Modified:
llvm/trunk/lib/Target/X86/X86SelectionDAGInfo.cpp
Modified: llvm/trunk/lib/Target/X86/X86SelectionDAGInfo.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/X86/X86SelectionDAGInfo.cpp?rev=114402&r1=114401&r2=114402&view=diff
==============================================================================
--- llvm/trunk/lib/Target/X86/X86SelectionDAGInfo.cpp (original)
+++ llvm/trunk/lib/Target/X86/X86SelectionDAGInfo.cpp Tue Sep 21 00:43:34 2010
@@ -35,6 +35,10 @@
MachinePointerInfo DstPtrInfo) const {
ConstantSDNode *ConstantSize = dyn_cast<ConstantSDNode>(Size);
+ // If to a segment-relative address space, use the default lowering.
+ if (DstPtrInfo.getAddrSpace() >= 256)
+ return SDValue();
+
// If not DWORD aligned or size is more than the threshold, call the library.
// The libc version is likely to be faster for these cases. It can use the
// address value and run time information about the CPU.
@@ -187,6 +191,11 @@
if ((Align & 3) != 0)
return SDValue();
+ // If to a segment-relative address space, use the default lowering.
+ if (DstPtrInfo.getAddrSpace() >= 256 ||
+ SrcPtrInfo.getAddrSpace() >= 256)
+ return SDValue();
+
// DWORD aligned
EVT AVT = MVT::i32;
if (Subtarget->is64Bit() && ((Align & 0x7) == 0)) // QWORD aligned
More information about the llvm-commits
mailing list