diff options
| author | Chris Lattner <sabre@nondot.org> | 2010-09-21 05:43:34 +0000 |
|---|---|---|
| committer | Chris Lattner <sabre@nondot.org> | 2010-09-21 05:43:34 +0000 |
| commit | 4470c2bb23f523d15aa87240848b612e29e8b123 (patch) | |
| tree | ee43a492849da390f121d53cadfca32aba6f619e /llvm/lib | |
| parent | 2510de2beadb5e635de10a425f5737a7acbde7a4 (diff) | |
| download | bcm5719-llvm-4470c2bb23f523d15aa87240848b612e29e8b123.tar.gz bcm5719-llvm-4470c2bb23f523d15aa87240848b612e29e8b123.zip | |
Fix a bug where the x86 backend would lower memcpy/memset of segment relative operations
into non-segment-relative copies.
llvm-svn: 114402
Diffstat (limited to 'llvm/lib')
| -rw-r--r-- | llvm/lib/Target/X86/X86SelectionDAGInfo.cpp | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/llvm/lib/Target/X86/X86SelectionDAGInfo.cpp b/llvm/lib/Target/X86/X86SelectionDAGInfo.cpp index 99a9cd5e646..c59d4074c7a 100644 --- a/llvm/lib/Target/X86/X86SelectionDAGInfo.cpp +++ b/llvm/lib/Target/X86/X86SelectionDAGInfo.cpp @@ -35,6 +35,10 @@ X86SelectionDAGInfo::EmitTargetCodeForMemset(SelectionDAG &DAG, DebugLoc dl, 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 @@ X86SelectionDAGInfo::EmitTargetCodeForMemcpy(SelectionDAG &DAG, DebugLoc dl, 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 |

