[llvm] [RISCV] Support the large code model. (PR #70308)

Craig Topper via llvm-commits llvm-commits at lists.llvm.org
Mon Aug 26 23:52:35 PDT 2024


================
@@ -20101,7 +20137,14 @@ SDValue RISCVTargetLowering::LowerCall(CallLoweringInfo &CLI,
   // If the callee is a GlobalAddress/ExternalSymbol node, turn it into a
   // TargetGlobalAddress/TargetExternalSymbol node so that legalize won't
   // split it and then direct call can be matched by PseudoCALL.
-  if (GlobalAddressSDNode *S = dyn_cast<GlobalAddressSDNode>(Callee)) {
+  if (getTargetMachine().getCodeModel() == CodeModel::Large) {
+    if (GlobalAddressSDNode *S = dyn_cast<GlobalAddressSDNode>(Callee)) {
----------------
topperc wrote:

Drop curly braces around single line statements.

https://github.com/llvm/llvm-project/pull/70308


More information about the llvm-commits mailing list