@@ -6452,15 +6452,15 @@ SDValue RISCVTargetLowering::getAddr(NodeTy *N, SelectionDAG &DAG,
6452
6452
// Use PC-relative addressing to access the GOT for this symbol, then load
6453
6453
// the address from the GOT. This generates the pattern (PseudoLGA sym),
6454
6454
// which expands to (ld (addi (auipc %got_pcrel_hi(sym)) %pcrel_lo(auipc))).
6455
+ SDValue Load =
6456
+ SDValue(DAG.getMachineNode(RISCV::PseudoLGA, DL, Ty, Addr), 0);
6455
6457
MachineFunction &MF = DAG.getMachineFunction();
6456
6458
MachineMemOperand *MemOp = MF.getMachineMemOperand(
6457
6459
MachinePointerInfo::getGOT(MF),
6458
6460
MachineMemOperand::MOLoad | MachineMemOperand::MODereferenceable |
6459
6461
MachineMemOperand::MOInvariant,
6460
6462
LLT(Ty.getSimpleVT()), Align(Ty.getFixedSizeInBits() / 8));
6461
- SDValue Load =
6462
- DAG.getMemIntrinsicNode(RISCVISD::LGA, DL, DAG.getVTList(Ty, MVT::Other),
6463
- {DAG.getEntryNode(), Addr}, Ty, MemOp);
6463
+ DAG.setNodeMemRefs(cast<MachineSDNode>(Load.getNode()), {MemOp});
6464
6464
return Load;
6465
6465
}
6466
6466
@@ -6482,16 +6482,15 @@ SDValue RISCVTargetLowering::getAddr(NodeTy *N, SelectionDAG &DAG,
6482
6482
// not be within 2GiB of PC, so use GOT-indirect addressing to access the
6483
6483
// symbol. This generates the pattern (PseudoLGA sym), which expands to
6484
6484
// (ld (addi (auipc %got_pcrel_hi(sym)) %pcrel_lo(auipc))).
6485
+ SDValue Load =
6486
+ SDValue(DAG.getMachineNode(RISCV::PseudoLGA, DL, Ty, Addr), 0);
6485
6487
MachineFunction &MF = DAG.getMachineFunction();
6486
6488
MachineMemOperand *MemOp = MF.getMachineMemOperand(
6487
6489
MachinePointerInfo::getGOT(MF),
6488
6490
MachineMemOperand::MOLoad | MachineMemOperand::MODereferenceable |
6489
6491
MachineMemOperand::MOInvariant,
6490
6492
LLT(Ty.getSimpleVT()), Align(Ty.getFixedSizeInBits() / 8));
6491
- SDValue Load =
6492
- DAG.getMemIntrinsicNode(RISCVISD::LGA, DL,
6493
- DAG.getVTList(Ty, MVT::Other),
6494
- {DAG.getEntryNode(), Addr}, Ty, MemOp);
6493
+ DAG.setNodeMemRefs(cast<MachineSDNode>(Load.getNode()), {MemOp});
6495
6494
return Load;
6496
6495
}
6497
6496
@@ -6546,15 +6545,15 @@ SDValue RISCVTargetLowering::getStaticTLSAddr(GlobalAddressSDNode *N,
6546
6545
// the pattern (PseudoLA_TLS_IE sym), which expands to
6547
6546
// (ld (auipc %tls_ie_pcrel_hi(sym)) %pcrel_lo(auipc)).
6548
6547
SDValue Addr = DAG.getTargetGlobalAddress(GV, DL, Ty, 0, 0);
6548
+ SDValue Load =
6549
+ SDValue(DAG.getMachineNode(RISCV::PseudoLA_TLS_IE, DL, Ty, Addr), 0);
6549
6550
MachineFunction &MF = DAG.getMachineFunction();
6550
6551
MachineMemOperand *MemOp = MF.getMachineMemOperand(
6551
6552
MachinePointerInfo::getGOT(MF),
6552
6553
MachineMemOperand::MOLoad | MachineMemOperand::MODereferenceable |
6553
6554
MachineMemOperand::MOInvariant,
6554
6555
LLT(Ty.getSimpleVT()), Align(Ty.getFixedSizeInBits() / 8));
6555
- SDValue Load = DAG.getMemIntrinsicNode(
6556
- RISCVISD::LA_TLS_IE, DL, DAG.getVTList(Ty, MVT::Other),
6557
- {DAG.getEntryNode(), Addr}, Ty, MemOp);
6556
+ DAG.setNodeMemRefs(cast<MachineSDNode>(Load.getNode()), {MemOp});
6558
6557
6559
6558
// Add the thread pointer.
6560
6559
SDValue TPReg = DAG.getRegister(RISCV::X4, XLenVT);
@@ -6590,7 +6589,8 @@ SDValue RISCVTargetLowering::getDynamicTLSAddr(GlobalAddressSDNode *N,
6590
6589
// This generates the pattern (PseudoLA_TLS_GD sym), which expands to
6591
6590
// (addi (auipc %tls_gd_pcrel_hi(sym)) %pcrel_lo(auipc)).
6592
6591
SDValue Addr = DAG.getTargetGlobalAddress(GV, DL, Ty, 0, 0);
6593
- SDValue Load = DAG.getNode(RISCVISD::LA_TLS_GD, DL, Ty, Addr);
6592
+ SDValue Load =
6593
+ SDValue(DAG.getMachineNode(RISCV::PseudoLA_TLS_GD, DL, Ty, Addr), 0);
6594
6594
6595
6595
// Prepare argument list to generate call.
6596
6596
ArgListTy Args;
@@ -17787,10 +17787,7 @@ const char *RISCVTargetLowering::getTargetNodeName(unsigned Opcode) const {
17787
17787
NODE_NAME_CASE(ADD_LO)
17788
17788
NODE_NAME_CASE(HI)
17789
17789
NODE_NAME_CASE(LLA)
17790
- NODE_NAME_CASE(LGA)
17791
17790
NODE_NAME_CASE(ADD_TPREL)
17792
- NODE_NAME_CASE(LA_TLS_IE)
17793
- NODE_NAME_CASE(LA_TLS_GD)
17794
17791
NODE_NAME_CASE(MULHSU)
17795
17792
NODE_NAME_CASE(SLLW)
17796
17793
NODE_NAME_CASE(SRAW)
0 commit comments