Skip to content

Commit 1b8e26f

Browse files
committed
[RISCV] Use RISCVSubtarget to get XLen in CC_RISCV. NFC
1 parent 23a26e7 commit 1b8e26f

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

llvm/lib/Target/RISCV/RISCVCallingConv.cpp

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -255,9 +255,8 @@ bool llvm::CC_RISCV(unsigned ValNo, MVT ValVT, MVT LocVT,
255255
const RISCVSubtarget &Subtarget = MF.getSubtarget<RISCVSubtarget>();
256256
const RISCVTargetLowering &TLI = *Subtarget.getTargetLowering();
257257

258-
unsigned XLen = DL.getLargestLegalIntTypeSizeInBits();
259-
assert(XLen == 32 || XLen == 64);
260-
MVT XLenVT = XLen == 32 ? MVT::i32 : MVT::i64;
258+
unsigned XLen = Subtarget.getXLen();
259+
MVT XLenVT = Subtarget.getXLenVT();
261260

262261
// Static chain parameter must not be passed in normal argument registers,
263262
// so we assign t2 for it as done in GCC's __builtin_call_with_static_chain

0 commit comments

Comments
 (0)