mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-06-13 22:24:07 +00:00
Add addrspacecast instruction.
Patch by Michele Scandale! git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@194760 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@ -1507,6 +1507,26 @@ SDValue SelectionDAG::getMDNode(const MDNode *MD) {
|
||||
return SDValue(N, 0);
|
||||
}
|
||||
|
||||
/// getAddrSpaceCast - Return an AddrSpaceCastSDNode.
|
||||
SDValue SelectionDAG::getAddrSpaceCast(SDLoc dl, EVT VT, SDValue Ptr,
|
||||
unsigned SrcAS, unsigned DestAS) {
|
||||
SDValue Ops[] = {Ptr};
|
||||
FoldingSetNodeID ID;
|
||||
AddNodeIDNode(ID, ISD::ADDRSPACECAST, getVTList(VT), &Ops[0], 1);
|
||||
ID.AddInteger(SrcAS);
|
||||
ID.AddInteger(DestAS);
|
||||
|
||||
void *IP = 0;
|
||||
if (SDNode *E = CSEMap.FindNodeOrInsertPos(ID, IP))
|
||||
return SDValue(E, 0);
|
||||
|
||||
SDNode *N = new (NodeAllocator) AddrSpaceCastSDNode(dl.getIROrder(),
|
||||
dl.getDebugLoc(),
|
||||
VT, Ptr, SrcAS, DestAS);
|
||||
CSEMap.InsertNode(N, IP);
|
||||
AllNodes.push_back(N);
|
||||
return SDValue(N, 0);
|
||||
}
|
||||
|
||||
/// getShiftAmountOperand - Return the specified value casted to
|
||||
/// the target's desired shift amount type.
|
||||
@ -5978,6 +5998,12 @@ GlobalAddressSDNode::GlobalAddressSDNode(unsigned Opc, unsigned Order,
|
||||
TheGlobal = GA;
|
||||
}
|
||||
|
||||
AddrSpaceCastSDNode::AddrSpaceCastSDNode(unsigned Order, DebugLoc dl, EVT VT,
|
||||
SDValue X, unsigned SrcAS,
|
||||
unsigned DestAS)
|
||||
: UnarySDNode(ISD::ADDRSPACECAST, Order, dl, getSDVTList(VT), X),
|
||||
SrcAddrSpace(SrcAS), DestAddrSpace(DestAS) {}
|
||||
|
||||
MemSDNode::MemSDNode(unsigned Opc, unsigned Order, DebugLoc dl, SDVTList VTs,
|
||||
EVT memvt, MachineMemOperand *mmo)
|
||||
: SDNode(Opc, Order, dl, VTs), MemoryVT(memvt), MMO(mmo) {
|
||||
|
Reference in New Issue
Block a user