mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-03-15 22:32:35 +00:00
add overloads for SelectionDAG::getLoad, getStore, getTruncStore that take a
MachinePointerInfo. Among other virtues, this doesn't silently truncate the svoffset to 32-bits. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@114399 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
e9ba5dd236
commit
5c5cb2a171
@ -643,6 +643,11 @@ public:
|
|||||||
SDValue Chain, SDValue Ptr, SDValue Offset,
|
SDValue Chain, SDValue Ptr, SDValue Offset,
|
||||||
const Value *SV, int SVOffset, EVT MemVT,
|
const Value *SV, int SVOffset, EVT MemVT,
|
||||||
bool isVolatile, bool isNonTemporal, unsigned Alignment);
|
bool isVolatile, bool isNonTemporal, unsigned Alignment);
|
||||||
|
SDValue getLoad(ISD::MemIndexedMode AM, ISD::LoadExtType ExtType,
|
||||||
|
EVT VT, DebugLoc dl,
|
||||||
|
SDValue Chain, SDValue Ptr, SDValue Offset,
|
||||||
|
MachinePointerInfo PtrInfo, EVT MemVT,
|
||||||
|
bool isVolatile, bool isNonTemporal, unsigned Alignment);
|
||||||
SDValue getLoad(ISD::MemIndexedMode AM, ISD::LoadExtType ExtType,
|
SDValue getLoad(ISD::MemIndexedMode AM, ISD::LoadExtType ExtType,
|
||||||
EVT VT, DebugLoc dl,
|
EVT VT, DebugLoc dl,
|
||||||
SDValue Chain, SDValue Ptr, SDValue Offset,
|
SDValue Chain, SDValue Ptr, SDValue Offset,
|
||||||
@ -651,10 +656,17 @@ public:
|
|||||||
/// getStore - Helper function to build ISD::STORE nodes.
|
/// getStore - Helper function to build ISD::STORE nodes.
|
||||||
///
|
///
|
||||||
SDValue getStore(SDValue Chain, DebugLoc dl, SDValue Val, SDValue Ptr,
|
SDValue getStore(SDValue Chain, DebugLoc dl, SDValue Val, SDValue Ptr,
|
||||||
const Value *SV, int SVOffset, bool isVolatile,
|
MachinePointerInfo PtrInfo, bool isVolatile,
|
||||||
|
bool isNonTemporal, unsigned Alignment);
|
||||||
|
SDValue getStore(SDValue Chain, DebugLoc dl, SDValue Val, SDValue Ptr,
|
||||||
|
const Value *V, int SVOffset, bool isVolatile,
|
||||||
bool isNonTemporal, unsigned Alignment);
|
bool isNonTemporal, unsigned Alignment);
|
||||||
SDValue getStore(SDValue Chain, DebugLoc dl, SDValue Val, SDValue Ptr,
|
SDValue getStore(SDValue Chain, DebugLoc dl, SDValue Val, SDValue Ptr,
|
||||||
MachineMemOperand *MMO);
|
MachineMemOperand *MMO);
|
||||||
|
SDValue getTruncStore(SDValue Chain, DebugLoc dl, SDValue Val, SDValue Ptr,
|
||||||
|
MachinePointerInfo PtrInfo, EVT TVT,
|
||||||
|
bool isNonTemporal, bool isVolatile,
|
||||||
|
unsigned Alignment);
|
||||||
SDValue getTruncStore(SDValue Chain, DebugLoc dl, SDValue Val, SDValue Ptr,
|
SDValue getTruncStore(SDValue Chain, DebugLoc dl, SDValue Val, SDValue Ptr,
|
||||||
const Value *SV, int SVOffset, EVT TVT,
|
const Value *SV, int SVOffset, EVT TVT,
|
||||||
bool isNonTemporal, bool isVolatile,
|
bool isNonTemporal, bool isVolatile,
|
||||||
|
@ -3865,14 +3865,27 @@ SelectionDAG::getLoad(ISD::MemIndexedMode AM, ISD::LoadExtType ExtType,
|
|||||||
const Value *SV, int SVOffset, EVT MemVT,
|
const Value *SV, int SVOffset, EVT MemVT,
|
||||||
bool isVolatile, bool isNonTemporal,
|
bool isVolatile, bool isNonTemporal,
|
||||||
unsigned Alignment) {
|
unsigned Alignment) {
|
||||||
if (Alignment == 0) // Ensure that codegen never sees alignment 0
|
|
||||||
Alignment = getEVTAlignment(VT);
|
|
||||||
|
|
||||||
// Check if the memory reference references a frame index
|
// Check if the memory reference references a frame index
|
||||||
if (!SV)
|
if (!SV)
|
||||||
if (const FrameIndexSDNode *FI =
|
if (const FrameIndexSDNode *FI =
|
||||||
dyn_cast<const FrameIndexSDNode>(Ptr.getNode()))
|
dyn_cast<const FrameIndexSDNode>(Ptr.getNode()))
|
||||||
SV = PseudoSourceValue::getFixedStack(FI->getIndex());
|
SV = PseudoSourceValue::getFixedStack(FI->getIndex());
|
||||||
|
|
||||||
|
return getLoad(AM, ExtType, VT, dl, Chain, Ptr, Offset,
|
||||||
|
MachinePointerInfo(SV, SVOffset), MemVT, isVolatile,
|
||||||
|
isNonTemporal, Alignment);
|
||||||
|
}
|
||||||
|
|
||||||
|
SDValue
|
||||||
|
SelectionDAG::getLoad(ISD::MemIndexedMode AM, ISD::LoadExtType ExtType,
|
||||||
|
EVT VT, DebugLoc dl, SDValue Chain,
|
||||||
|
SDValue Ptr, SDValue Offset,
|
||||||
|
MachinePointerInfo PtrInfo, EVT MemVT,
|
||||||
|
bool isVolatile, bool isNonTemporal,
|
||||||
|
unsigned Alignment) {
|
||||||
|
if (Alignment == 0) // Ensure that codegen never sees alignment 0
|
||||||
|
Alignment = getEVTAlignment(VT);
|
||||||
|
|
||||||
MachineFunction &MF = getMachineFunction();
|
MachineFunction &MF = getMachineFunction();
|
||||||
unsigned Flags = MachineMemOperand::MOLoad;
|
unsigned Flags = MachineMemOperand::MOLoad;
|
||||||
@ -3881,8 +3894,7 @@ SelectionDAG::getLoad(ISD::MemIndexedMode AM, ISD::LoadExtType ExtType,
|
|||||||
if (isNonTemporal)
|
if (isNonTemporal)
|
||||||
Flags |= MachineMemOperand::MONonTemporal;
|
Flags |= MachineMemOperand::MONonTemporal;
|
||||||
MachineMemOperand *MMO =
|
MachineMemOperand *MMO =
|
||||||
MF.getMachineMemOperand(MachinePointerInfo(SV, SVOffset), Flags,
|
MF.getMachineMemOperand(PtrInfo, Flags, MemVT.getStoreSize(), Alignment);
|
||||||
MemVT.getStoreSize(), Alignment);
|
|
||||||
return getLoad(AM, ExtType, VT, dl, Chain, Ptr, Offset, MemVT, MMO);
|
return getLoad(AM, ExtType, VT, dl, Chain, Ptr, Offset, MemVT, MMO);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -3966,18 +3978,12 @@ SelectionDAG::getIndexedLoad(SDValue OrigLoad, DebugLoc dl, SDValue Base,
|
|||||||
}
|
}
|
||||||
|
|
||||||
SDValue SelectionDAG::getStore(SDValue Chain, DebugLoc dl, SDValue Val,
|
SDValue SelectionDAG::getStore(SDValue Chain, DebugLoc dl, SDValue Val,
|
||||||
SDValue Ptr, const Value *SV, int SVOffset,
|
SDValue Ptr, MachinePointerInfo PtrInfo,
|
||||||
bool isVolatile, bool isNonTemporal,
|
bool isVolatile, bool isNonTemporal,
|
||||||
unsigned Alignment) {
|
unsigned Alignment) {
|
||||||
if (Alignment == 0) // Ensure that codegen never sees alignment 0
|
if (Alignment == 0) // Ensure that codegen never sees alignment 0
|
||||||
Alignment = getEVTAlignment(Val.getValueType());
|
Alignment = getEVTAlignment(Val.getValueType());
|
||||||
|
|
||||||
// Check if the memory reference references a frame index
|
|
||||||
if (!SV)
|
|
||||||
if (const FrameIndexSDNode *FI =
|
|
||||||
dyn_cast<const FrameIndexSDNode>(Ptr.getNode()))
|
|
||||||
SV = PseudoSourceValue::getFixedStack(FI->getIndex());
|
|
||||||
|
|
||||||
MachineFunction &MF = getMachineFunction();
|
MachineFunction &MF = getMachineFunction();
|
||||||
unsigned Flags = MachineMemOperand::MOStore;
|
unsigned Flags = MachineMemOperand::MOStore;
|
||||||
if (isVolatile)
|
if (isVolatile)
|
||||||
@ -3985,12 +3991,27 @@ SDValue SelectionDAG::getStore(SDValue Chain, DebugLoc dl, SDValue Val,
|
|||||||
if (isNonTemporal)
|
if (isNonTemporal)
|
||||||
Flags |= MachineMemOperand::MONonTemporal;
|
Flags |= MachineMemOperand::MONonTemporal;
|
||||||
MachineMemOperand *MMO =
|
MachineMemOperand *MMO =
|
||||||
MF.getMachineMemOperand(MachinePointerInfo(SV, SVOffset), Flags,
|
MF.getMachineMemOperand(PtrInfo, Flags,
|
||||||
Val.getValueType().getStoreSize(), Alignment);
|
Val.getValueType().getStoreSize(), Alignment);
|
||||||
|
|
||||||
return getStore(Chain, dl, Val, Ptr, MMO);
|
return getStore(Chain, dl, Val, Ptr, MMO);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
SDValue SelectionDAG::getStore(SDValue Chain, DebugLoc dl, SDValue Val,
|
||||||
|
SDValue Ptr,
|
||||||
|
const Value *SV, int SVOffset, bool isVolatile,
|
||||||
|
bool isNonTemporal, unsigned Alignment) {
|
||||||
|
// Check if the memory reference references a frame index
|
||||||
|
if (!SV)
|
||||||
|
if (const FrameIndexSDNode *FI =
|
||||||
|
dyn_cast<const FrameIndexSDNode>(Ptr.getNode()))
|
||||||
|
SV = PseudoSourceValue::getFixedStack(FI->getIndex());
|
||||||
|
|
||||||
|
return getStore(Chain, dl, Val, Ptr, MachinePointerInfo(SV, SVOffset),
|
||||||
|
isVolatile, isNonTemporal, Alignment);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
SDValue SelectionDAG::getStore(SDValue Chain, DebugLoc dl, SDValue Val,
|
SDValue SelectionDAG::getStore(SDValue Chain, DebugLoc dl, SDValue Val,
|
||||||
SDValue Ptr, MachineMemOperand *MMO) {
|
SDValue Ptr, MachineMemOperand *MMO) {
|
||||||
EVT VT = Val.getValueType();
|
EVT VT = Val.getValueType();
|
||||||
@ -4019,14 +4040,23 @@ SDValue SelectionDAG::getTruncStore(SDValue Chain, DebugLoc dl, SDValue Val,
|
|||||||
int SVOffset, EVT SVT,
|
int SVOffset, EVT SVT,
|
||||||
bool isVolatile, bool isNonTemporal,
|
bool isVolatile, bool isNonTemporal,
|
||||||
unsigned Alignment) {
|
unsigned Alignment) {
|
||||||
if (Alignment == 0) // Ensure that codegen never sees alignment 0
|
|
||||||
Alignment = getEVTAlignment(SVT);
|
|
||||||
|
|
||||||
// Check if the memory reference references a frame index
|
// Check if the memory reference references a frame index
|
||||||
if (!SV)
|
if (!SV)
|
||||||
if (const FrameIndexSDNode *FI =
|
if (const FrameIndexSDNode *FI =
|
||||||
dyn_cast<const FrameIndexSDNode>(Ptr.getNode()))
|
dyn_cast<const FrameIndexSDNode>(Ptr.getNode()))
|
||||||
SV = PseudoSourceValue::getFixedStack(FI->getIndex());
|
SV = PseudoSourceValue::getFixedStack(FI->getIndex());
|
||||||
|
|
||||||
|
return getTruncStore(Chain, dl, Val, Ptr, MachinePointerInfo(SV, SVOffset),
|
||||||
|
SVT, isVolatile, isNonTemporal, Alignment);
|
||||||
|
}
|
||||||
|
|
||||||
|
SDValue SelectionDAG::getTruncStore(SDValue Chain, DebugLoc dl, SDValue Val,
|
||||||
|
SDValue Ptr, MachinePointerInfo PtrInfo,
|
||||||
|
EVT SVT,bool isVolatile, bool isNonTemporal,
|
||||||
|
unsigned Alignment) {
|
||||||
|
if (Alignment == 0) // Ensure that codegen never sees alignment 0
|
||||||
|
Alignment = getEVTAlignment(SVT);
|
||||||
|
|
||||||
MachineFunction &MF = getMachineFunction();
|
MachineFunction &MF = getMachineFunction();
|
||||||
unsigned Flags = MachineMemOperand::MOStore;
|
unsigned Flags = MachineMemOperand::MOStore;
|
||||||
@ -4035,8 +4065,7 @@ SDValue SelectionDAG::getTruncStore(SDValue Chain, DebugLoc dl, SDValue Val,
|
|||||||
if (isNonTemporal)
|
if (isNonTemporal)
|
||||||
Flags |= MachineMemOperand::MONonTemporal;
|
Flags |= MachineMemOperand::MONonTemporal;
|
||||||
MachineMemOperand *MMO =
|
MachineMemOperand *MMO =
|
||||||
MF.getMachineMemOperand(MachinePointerInfo(SV, SVOffset), Flags,
|
MF.getMachineMemOperand(PtrInfo, Flags, SVT.getStoreSize(), Alignment);
|
||||||
SVT.getStoreSize(), Alignment);
|
|
||||||
|
|
||||||
return getTruncStore(Chain, dl, Val, Ptr, SVT, MMO);
|
return getTruncStore(Chain, dl, Val, Ptr, SVT, MMO);
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user