mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-02-14 17:34:41 +00:00
Fix a bug where the x86 backend would lower memcpy/memset of segment relative operations
into non-segment-relative copies. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@114402 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
e72f2027e9
commit
e54b482d1c
@ -35,6 +35,10 @@ X86SelectionDAGInfo::EmitTargetCodeForMemset(SelectionDAG &DAG, DebugLoc dl,
|
|||||||
MachinePointerInfo DstPtrInfo) const {
|
MachinePointerInfo DstPtrInfo) const {
|
||||||
ConstantSDNode *ConstantSize = dyn_cast<ConstantSDNode>(Size);
|
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.
|
// 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
|
// The libc version is likely to be faster for these cases. It can use the
|
||||||
// address value and run time information about the CPU.
|
// address value and run time information about the CPU.
|
||||||
@ -187,6 +191,11 @@ X86SelectionDAGInfo::EmitTargetCodeForMemcpy(SelectionDAG &DAG, DebugLoc dl,
|
|||||||
if ((Align & 3) != 0)
|
if ((Align & 3) != 0)
|
||||||
return SDValue();
|
return SDValue();
|
||||||
|
|
||||||
|
// If to a segment-relative address space, use the default lowering.
|
||||||
|
if (DstPtrInfo.getAddrSpace() >= 256 ||
|
||||||
|
SrcPtrInfo.getAddrSpace() >= 256)
|
||||||
|
return SDValue();
|
||||||
|
|
||||||
// DWORD aligned
|
// DWORD aligned
|
||||||
EVT AVT = MVT::i32;
|
EVT AVT = MVT::i32;
|
||||||
if (Subtarget->is64Bit() && ((Align & 0x7) == 0)) // QWORD aligned
|
if (Subtarget->is64Bit() && ((Align & 0x7) == 0)) // QWORD aligned
|
||||||
|
Loading…
x
Reference in New Issue
Block a user