Skip to content

Commit 1c43aa4

Browse files
committed
[RISCV] Kill off redundant field XLenVT [nfc]
We're already tracking XLen, we can compute XLenVt from that. Note that XLen itself should probably be driven from IsRV64 (the processor flag), but I'm leaving that to a separate change (with review).
1 parent d1c3784 commit 1c43aa4

File tree

2 files changed

+9
-6
lines changed

2 files changed

+9
-6
lines changed

llvm/lib/Target/RISCV/RISCVSubtarget.cpp

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -66,10 +66,8 @@ RISCVSubtarget::initializeSubtargetDependencies(const Triple &TT, StringRef CPU,
6666
TuneCPU = CPU;
6767

6868
ParseSubtargetFeatures(CPU, TuneCPU, FS);
69-
if (Is64Bit) {
70-
XLenVT = MVT::i64;
69+
if (Is64Bit)
7170
XLen = 64;
72-
}
7371

7472
TargetABI = RISCVABI::computeTargetABI(TT, getFeatureBits(), ABIName);
7573
RISCVFeatures::validate(TT, getFeatureBits());

llvm/lib/Target/RISCV/RISCVSubtarget.h

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,6 @@ class RISCVSubtarget : public RISCVGenSubtargetInfo {
5050

5151
unsigned XLen = 32;
5252
unsigned ZvlLen = 0;
53-
MVT XLenVT = MVT::i32;
5453
unsigned RVVVectorBitsMin;
5554
unsigned RVVVectorBitsMax;
5655
uint8_t MaxInterleaveFactor = 2;
@@ -127,8 +126,14 @@ class RISCVSubtarget : public RISCVGenSubtargetInfo {
127126
return hasStdExtZfhOrZfhmin() || HasStdExtZfbfmin;
128127
}
129128
bool is64Bit() const { return IsRV64; }
130-
MVT getXLenVT() const { return XLenVT; }
131-
unsigned getXLen() const { return XLen; }
129+
MVT getXLenVT() const {
130+
return MVT::getIntegerVT(getXLen());
131+
}
132+
unsigned getXLen() const {
133+
assert((XLen == 32 || XLen == 64) &&
134+
"unexpected xlen");
135+
return XLen;
136+
}
132137
unsigned getFLen() const {
133138
if (HasStdExtD)
134139
return 64;

0 commit comments

Comments
 (0)