Skip to content

Commit 4be2bcc

Browse files
committed
Inline getLargeAddr function
1 parent 6216bc5 commit 4be2bcc

File tree

1 file changed

+6
-11
lines changed

1 file changed

+6
-11
lines changed

llvm/lib/Target/RISCV/RISCVISelLowering.cpp

Lines changed: 6 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -7429,16 +7429,6 @@ static SDValue getLargeExternalSymbol(ExternalSymbolSDNode *N, SDLoc DL, EVT Ty,
74297429
MachinePointerInfo::getConstantPool(DAG.getMachineFunction()));
74307430
}
74317431

7432-
template <class NodeTy>
7433-
static SDValue getLargeAddr(NodeTy *N, SDLoc DL, EVT Ty, SelectionDAG &DAG) {
7434-
if (GlobalAddressSDNode *G = dyn_cast<GlobalAddressSDNode>(N))
7435-
return getLargeGlobalAddress(G, DL, Ty, DAG);
7436-
7437-
// Using pc-relative mode for other node type.
7438-
SDValue Addr = getTargetNode(N, DL, Ty, DAG, 0);
7439-
return DAG.getNode(RISCVISD::LLA, DL, Ty, Addr);
7440-
}
7441-
74427432
template <class NodeTy>
74437433
SDValue RISCVTargetLowering::getAddr(NodeTy *N, SelectionDAG &DAG,
74447434
bool IsLocal, bool IsExternWeak) const {
@@ -7508,7 +7498,12 @@ SDValue RISCVTargetLowering::getAddr(NodeTy *N, SelectionDAG &DAG,
75087498
return DAG.getNode(RISCVISD::LLA, DL, Ty, Addr);
75097499
}
75107500
case CodeModel::Large: {
7511-
return getLargeAddr(N, DL, Ty, DAG);
7501+
if (GlobalAddressSDNode *G = dyn_cast<GlobalAddressSDNode>(N))
7502+
return getLargeGlobalAddress(G, DL, Ty, DAG);
7503+
7504+
// Using pc-relative mode for other node type.
7505+
SDValue Addr = getTargetNode(N, DL, Ty, DAG, 0);
7506+
return DAG.getNode(RISCVISD::LLA, DL, Ty, Addr);
75127507
}
75137508
}
75147509
}

0 commit comments

Comments
 (0)