[llvm] 1b8e26f - [RISCV] Use RISCVSubtarget to get XLen in CC_RISCV. NFC

Craig Topper via llvm-commits llvm-commits at lists.llvm.org
Sat Sep 7 10:32:36 PDT 2024


Author: Craig Topper
Date: 2024-09-07T10:31:58-07:00
New Revision: 1b8e26ff26be7c769d68bc44920026f56ed588b6

URL: https://github.com/llvm/llvm-project/commit/1b8e26ff26be7c769d68bc44920026f56ed588b6
DIFF: https://github.com/llvm/llvm-project/commit/1b8e26ff26be7c769d68bc44920026f56ed588b6.diff

LOG: [RISCV] Use RISCVSubtarget to get XLen in CC_RISCV. NFC

Added: 
    

Modified: 
    llvm/lib/Target/RISCV/RISCVCallingConv.cpp

Removed: 
    


################################################################################
diff  --git a/llvm/lib/Target/RISCV/RISCVCallingConv.cpp b/llvm/lib/Target/RISCV/RISCVCallingConv.cpp
index 8a78ed6f2f8068..e81cddb086f062 100644
--- a/llvm/lib/Target/RISCV/RISCVCallingConv.cpp
+++ b/llvm/lib/Target/RISCV/RISCVCallingConv.cpp
@@ -255,9 +255,8 @@ bool llvm::CC_RISCV(unsigned ValNo, MVT ValVT, MVT LocVT,
   const RISCVSubtarget &Subtarget = MF.getSubtarget<RISCVSubtarget>();
   const RISCVTargetLowering &TLI = *Subtarget.getTargetLowering();
 
-  unsigned XLen = DL.getLargestLegalIntTypeSizeInBits();
-  assert(XLen == 32 || XLen == 64);
-  MVT XLenVT = XLen == 32 ? MVT::i32 : MVT::i64;
+  unsigned XLen = Subtarget.getXLen();
+  MVT XLenVT = Subtarget.getXLenVT();
 
   // Static chain parameter must not be passed in normal argument registers,
   // so we assign t2 for it as done in GCC's __builtin_call_with_static_chain


        


More information about the llvm-commits mailing list