@@ -3613,15 +3613,15 @@ SDValue RISCVTargetLowering::getAddr(NodeTy *N, SelectionDAG &DAG,
3613
3613
// Use PC-relative addressing to access the GOT for this symbol, then load
3614
3614
// the address from the GOT. This generates the pattern (PseudoLA sym),
3615
3615
// which expands to (ld (addi (auipc %got_pcrel_hi(sym)) %pcrel_lo(auipc))).
3616
- SDValue Load =
3617
- SDValue (DAG.getMachineNode (RISCV::PseudoLA, DL, Ty, Addr), 0 );
3618
3616
MachineFunction &MF = DAG.getMachineFunction ();
3619
3617
MachineMemOperand *MemOp = MF.getMachineMemOperand (
3620
3618
MachinePointerInfo::getGOT (MF),
3621
3619
MachineMemOperand::MOLoad | MachineMemOperand::MODereferenceable |
3622
3620
MachineMemOperand::MOInvariant,
3623
3621
LLT (Ty.getSimpleVT ()), Align (Ty.getFixedSizeInBits () / 8 ));
3624
- DAG.setNodeMemRefs (cast<MachineSDNode>(Load.getNode ()), {MemOp});
3622
+ SDValue Load =
3623
+ DAG.getMemIntrinsicNode (RISCVISD::LA, DL, DAG.getVTList (Ty, MVT::Other),
3624
+ {DAG.getEntryNode (), Addr}, Ty, MemOp);
3625
3625
return Load;
3626
3626
}
3627
3627
@@ -3692,15 +3692,15 @@ SDValue RISCVTargetLowering::getStaticTLSAddr(GlobalAddressSDNode *N,
3692
3692
// the pattern (PseudoLA_TLS_IE sym), which expands to
3693
3693
// (ld (auipc %tls_ie_pcrel_hi(sym)) %pcrel_lo(auipc)).
3694
3694
SDValue Addr = DAG.getTargetGlobalAddress (GV, DL, Ty, 0 , 0 );
3695
- SDValue Load =
3696
- SDValue (DAG.getMachineNode (RISCV::PseudoLA_TLS_IE, DL, Ty, Addr), 0 );
3697
3695
MachineFunction &MF = DAG.getMachineFunction ();
3698
3696
MachineMemOperand *MemOp = MF.getMachineMemOperand (
3699
3697
MachinePointerInfo::getGOT (MF),
3700
3698
MachineMemOperand::MOLoad | MachineMemOperand::MODereferenceable |
3701
3699
MachineMemOperand::MOInvariant,
3702
3700
LLT (Ty.getSimpleVT ()), Align (Ty.getFixedSizeInBits () / 8 ));
3703
- DAG.setNodeMemRefs (cast<MachineSDNode>(Load.getNode ()), {MemOp});
3701
+ SDValue Load = DAG.getMemIntrinsicNode (
3702
+ RISCVISD::LA_TLS_IE, DL, DAG.getVTList (Ty, MVT::Other),
3703
+ {DAG.getEntryNode (), Addr}, Ty, MemOp);
3704
3704
3705
3705
// Add the thread pointer.
3706
3706
SDValue TPReg = DAG.getRegister (RISCV::X4, XLenVT);
@@ -3736,8 +3736,7 @@ SDValue RISCVTargetLowering::getDynamicTLSAddr(GlobalAddressSDNode *N,
3736
3736
// This generates the pattern (PseudoLA_TLS_GD sym), which expands to
3737
3737
// (addi (auipc %tls_gd_pcrel_hi(sym)) %pcrel_lo(auipc)).
3738
3738
SDValue Addr = DAG.getTargetGlobalAddress (GV, DL, Ty, 0 , 0 );
3739
- SDValue Load =
3740
- SDValue (DAG.getMachineNode (RISCV::PseudoLA_TLS_GD, DL, Ty, Addr), 0 );
3739
+ SDValue Load = DAG.getNode (RISCVISD::LA_TLS_GD, DL, Ty, Addr);
3741
3740
3742
3741
// Prepare argument list to generate call.
3743
3742
ArgListTy Args;
@@ -11184,6 +11183,9 @@ const char *RISCVTargetLowering::getTargetNodeName(unsigned Opcode) const {
11184
11183
NODE_NAME_CASE (HI)
11185
11184
NODE_NAME_CASE (LLA)
11186
11185
NODE_NAME_CASE (ADD_TPREL)
11186
+ NODE_NAME_CASE (LA)
11187
+ NODE_NAME_CASE (LA_TLS_IE)
11188
+ NODE_NAME_CASE (LA_TLS_GD)
11187
11189
NODE_NAME_CASE (MULHSU)
11188
11190
NODE_NAME_CASE (SLLW)
11189
11191
NODE_NAME_CASE (SRAW)
0 commit comments