Skip to content

Commit 3e89aca

Browse files
committed
[RISCV] Rename getELEN to getELen [nfc]
Let's follow the naming scheme use for DLen, XLen, and FLen.
1 parent bb63739 commit 3e89aca

File tree

3 files changed

+22
-22
lines changed

3 files changed

+22
-22
lines changed

llvm/lib/Target/RISCV/RISCVISelLowering.cpp

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -157,7 +157,7 @@ RISCVTargetLowering::RISCVTargetLowering(const TargetMachine &TM,
157157
auto addRegClassForRVV = [this](MVT VT) {
158158
// Disable the smallest fractional LMUL types if ELEN is less than
159159
// RVVBitsPerBlock.
160-
unsigned MinElts = RISCV::RVVBitsPerBlock / Subtarget.getELEN();
160+
unsigned MinElts = RISCV::RVVBitsPerBlock / Subtarget.getELen();
161161
if (VT.getVectorMinNumElements() < MinElts)
162162
return;
163163

@@ -1333,7 +1333,7 @@ bool RISCVTargetLowering::shouldExpandGetVectorLength(EVT TripCountVT,
13331333
return true;
13341334

13351335
// Don't allow VF=1 if those types are't legal.
1336-
if (VF < RISCV::RVVBitsPerBlock / Subtarget.getELEN())
1336+
if (VF < RISCV::RVVBitsPerBlock / Subtarget.getELen())
13371337
return true;
13381338

13391339
// VLEN=32 support is incomplete.
@@ -2341,7 +2341,7 @@ static bool useRVVForFixedLengthVectorVT(MVT VT,
23412341
}
23422342

23432343
// Reject elements larger than ELEN.
2344-
if (EltVT.getSizeInBits() > Subtarget.getELEN())
2344+
if (EltVT.getSizeInBits() > Subtarget.getELen())
23452345
return false;
23462346

23472347
unsigned LMul = divideCeil(VT.getSizeInBits(), MinVLen);
@@ -2370,7 +2370,7 @@ static MVT getContainerForFixedLengthVector(const TargetLowering &TLI, MVT VT,
23702370
"Expected legal fixed length vector!");
23712371

23722372
unsigned MinVLen = Subtarget.getRealMinVLen();
2373-
unsigned MaxELen = Subtarget.getELEN();
2373+
unsigned MaxELen = Subtarget.getELen();
23742374

23752375
MVT EltVT = VT.getVectorElementType();
23762376
switch (EltVT.SimpleTy) {
@@ -3222,7 +3222,7 @@ static SDValue lowerBuildVectorOfConstants(SDValue Op, SelectionDAG &DAG,
32223222
// XLenVT if we're producing a v8i1. This results in more consistent
32233223
// codegen across RV32 and RV64.
32243224
unsigned NumViaIntegerBits = std::clamp(NumElts, 8u, Subtarget.getXLen());
3225-
NumViaIntegerBits = std::min(NumViaIntegerBits, Subtarget.getELEN());
3225+
NumViaIntegerBits = std::min(NumViaIntegerBits, Subtarget.getELen());
32263226
// If we have to use more than one INSERT_VECTOR_ELT then this
32273227
// optimization is likely to increase code size; avoid peforming it in
32283228
// such a case. We can use a load from a constant pool in this case.
@@ -3722,7 +3722,7 @@ static bool isDeinterleaveShuffle(MVT VT, MVT ContainerVT, SDValue V1,
37223722
SDValue V2, ArrayRef<int> Mask,
37233723
const RISCVSubtarget &Subtarget) {
37243724
// Need to be able to widen the vector.
3725-
if (VT.getScalarSizeInBits() >= Subtarget.getELEN())
3725+
if (VT.getScalarSizeInBits() >= Subtarget.getELen())
37263726
return false;
37273727

37283728
// Both input must be extracts.
@@ -3766,7 +3766,7 @@ static bool isDeinterleaveShuffle(MVT VT, MVT ContainerVT, SDValue V1,
37663766
static bool isInterleaveShuffle(ArrayRef<int> Mask, MVT VT, int &EvenSrc,
37673767
int &OddSrc, const RISCVSubtarget &Subtarget) {
37683768
// We need to be able to widen elements to the next larger integer type.
3769-
if (VT.getScalarSizeInBits() >= Subtarget.getELEN())
3769+
if (VT.getScalarSizeInBits() >= Subtarget.getELen())
37703770
return false;
37713771

37723772
int Size = Mask.size();
@@ -4117,7 +4117,7 @@ static SDValue getWideningInterleave(SDValue EvenV, SDValue OddV,
41174117
OddV = convertToScalableVector(VecContainerVT, OddV, DAG, Subtarget);
41184118
}
41194119

4120-
assert(VecVT.getScalarSizeInBits() < Subtarget.getELEN());
4120+
assert(VecVT.getScalarSizeInBits() < Subtarget.getELen());
41214121

41224122
// We're working with a vector of the same size as the resulting
41234123
// interleaved vector, but with half the number of elements and
@@ -7385,7 +7385,7 @@ SDValue RISCVTargetLowering::lowerEXTRACT_VECTOR_ELT(SDValue Op,
73857385
unsigned WidenVecLen;
73867386
SDValue ExtractElementIdx;
73877387
SDValue ExtractBitIdx;
7388-
unsigned MaxEEW = Subtarget.getELEN();
7388+
unsigned MaxEEW = Subtarget.getELen();
73897389
MVT LargestEltVT = MVT::getIntegerVT(
73907390
std::min(MaxEEW, unsigned(XLenVT.getSizeInBits())));
73917391
if (NumElts <= LargestEltVT.getSizeInBits()) {
@@ -7686,7 +7686,7 @@ static SDValue lowerGetVectorLength(SDNode *N, SelectionDAG &DAG,
76867686
// Determine the VF that corresponds to LMUL 1 for ElementWidth.
76877687
unsigned LMul1VF = RISCV::RVVBitsPerBlock / ElementWidth;
76887688
// We don't support VF==1 with ELEN==32.
7689-
unsigned MinVF = RISCV::RVVBitsPerBlock / Subtarget.getELEN();
7689+
unsigned MinVF = RISCV::RVVBitsPerBlock / Subtarget.getELen();
76907690

76917691
unsigned VF = N->getConstantOperandVal(2);
76927692
assert(VF >= MinVF && VF <= (LMul1VF * 8) && isPowerOf2_32(VF) &&
@@ -8769,7 +8769,7 @@ SDValue RISCVTargetLowering::lowerVECTOR_DEINTERLEAVE(SDValue Op,
87698769

87708770
// We can deinterleave through vnsrl.wi if the element type is smaller than
87718771
// ELEN
8772-
if (VecVT.getScalarSizeInBits() < Subtarget.getELEN()) {
8772+
if (VecVT.getScalarSizeInBits() < Subtarget.getELen()) {
87738773
SDValue Even =
87748774
getDeinterleaveViaVNSRL(DL, VecVT, Concat, true, Subtarget, DAG);
87758775
SDValue Odd =
@@ -8838,7 +8838,7 @@ SDValue RISCVTargetLowering::lowerVECTOR_INTERLEAVE(SDValue Op,
88388838

88398839
// If the element type is smaller than ELEN, then we can interleave with
88408840
// vwaddu.vv and vwmaccu.vx
8841-
if (VecVT.getScalarSizeInBits() < Subtarget.getELEN()) {
8841+
if (VecVT.getScalarSizeInBits() < Subtarget.getELen()) {
88428842
Interleaved = getWideningInterleave(Op.getOperand(0), Op.getOperand(1), DL,
88438843
DAG, Subtarget);
88448844
} else {
@@ -17805,7 +17805,7 @@ EVT RISCVTargetLowering::getOptimalMemOpType(const MemOp &Op,
1780517805
// a large scalar constant and instead use vmv.v.x/i to do the
1780617806
// broadcast. For everything else, prefer ELenVT to minimize VL and thus
1780717807
// maximize the chance we can encode the size in the vsetvli.
17808-
MVT ELenVT = MVT::getIntegerVT(Subtarget.getELEN());
17808+
MVT ELenVT = MVT::getIntegerVT(Subtarget.getELen());
1780917809
MVT PreferredVT = (Op.isMemset() && !Op.isZeroMemset()) ? MVT::i8 : ELenVT;
1781017810

1781117811
// Do we have sufficient alignment for our preferred VT? If not, revert

llvm/lib/Target/RISCV/RISCVSubtarget.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -143,7 +143,7 @@ class RISCVSubtarget : public RISCVGenSubtargetInfo {
143143

144144
return 0;
145145
}
146-
unsigned getELEN() const {
146+
unsigned getELen() const {
147147
assert(hasVInstructions() && "Expected V extension");
148148
return hasVInstructionsI64() ? 64 : 32;
149149
}

llvm/lib/Target/RISCV/RISCVTargetTransformInfo.cpp

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -307,7 +307,7 @@ InstructionCost RISCVTTIImpl::getShuffleCost(TTI::ShuffleKind Kind,
307307
// If the size of the element is < ELEN then shuffles of interleaves and
308308
// deinterleaves of 2 vectors can be lowered into the following
309309
// sequences
310-
if (EltTp.getScalarSizeInBits() < ST->getELEN()) {
310+
if (EltTp.getScalarSizeInBits() < ST->getELen()) {
311311
// Example sequence:
312312
// vsetivli zero, 4, e8, mf4, ta, ma (ignored)
313313
// vwaddu.vv v10, v8, v9
@@ -1186,8 +1186,8 @@ InstructionCost RISCVTTIImpl::getCastInstrCost(unsigned Opcode, Type *Dst,
11861186
return BaseT::getCastInstrCost(Opcode, Dst, Src, CCH, CostKind, I);
11871187

11881188
// Skip if element size of Dst or Src is bigger than ELEN.
1189-
if (Src->getScalarSizeInBits() > ST->getELEN() ||
1190-
Dst->getScalarSizeInBits() > ST->getELEN())
1189+
if (Src->getScalarSizeInBits() > ST->getELen() ||
1190+
Dst->getScalarSizeInBits() > ST->getELen())
11911191
return BaseT::getCastInstrCost(Opcode, Dst, Src, CCH, CostKind, I);
11921192

11931193
int ISD = TLI->InstructionOpcodeToISD(Opcode);
@@ -1270,7 +1270,7 @@ RISCVTTIImpl::getMinMaxReductionCost(Intrinsic::ID IID, VectorType *Ty,
12701270
return BaseT::getMinMaxReductionCost(IID, Ty, FMF, CostKind);
12711271

12721272
// Skip if scalar size of Ty is bigger than ELEN.
1273-
if (Ty->getScalarSizeInBits() > ST->getELEN())
1273+
if (Ty->getScalarSizeInBits() > ST->getELen())
12741274
return BaseT::getMinMaxReductionCost(IID, Ty, FMF, CostKind);
12751275

12761276
std::pair<InstructionCost, MVT> LT = getTypeLegalizationCost(Ty);
@@ -1297,7 +1297,7 @@ RISCVTTIImpl::getArithmeticReductionCost(unsigned Opcode, VectorType *Ty,
12971297
return BaseT::getArithmeticReductionCost(Opcode, Ty, FMF, CostKind);
12981298

12991299
// Skip if scalar size of Ty is bigger than ELEN.
1300-
if (Ty->getScalarSizeInBits() > ST->getELEN())
1300+
if (Ty->getScalarSizeInBits() > ST->getELen())
13011301
return BaseT::getArithmeticReductionCost(Opcode, Ty, FMF, CostKind);
13021302

13031303
int ISD = TLI->InstructionOpcodeToISD(Opcode);
@@ -1332,7 +1332,7 @@ InstructionCost RISCVTTIImpl::getExtendedReductionCost(
13321332
FMF, CostKind);
13331333

13341334
// Skip if scalar size of ResTy is bigger than ELEN.
1335-
if (ResTy->getScalarSizeInBits() > ST->getELEN())
1335+
if (ResTy->getScalarSizeInBits() > ST->getELen())
13361336
return BaseT::getExtendedReductionCost(Opcode, IsUnsigned, ResTy, ValTy,
13371337
FMF, CostKind);
13381338

@@ -1412,7 +1412,7 @@ InstructionCost RISCVTTIImpl::getCmpSelInstrCost(unsigned Opcode, Type *ValTy,
14121412
I);
14131413

14141414
// Skip if scalar size of ValTy is bigger than ELEN.
1415-
if (ValTy->isVectorTy() && ValTy->getScalarSizeInBits() > ST->getELEN())
1415+
if (ValTy->isVectorTy() && ValTy->getScalarSizeInBits() > ST->getELen())
14161416
return BaseT::getCmpSelInstrCost(Opcode, ValTy, CondTy, VecPred, CostKind,
14171417
I);
14181418

@@ -1592,7 +1592,7 @@ InstructionCost RISCVTTIImpl::getArithmeticInstrCost(
15921592
Args, CxtI);
15931593

15941594
// Skip if scalar size of Ty is bigger than ELEN.
1595-
if (isa<VectorType>(Ty) && Ty->getScalarSizeInBits() > ST->getELEN())
1595+
if (isa<VectorType>(Ty) && Ty->getScalarSizeInBits() > ST->getELen())
15961596
return BaseT::getArithmeticInstrCost(Opcode, Ty, CostKind, Op1Info, Op2Info,
15971597
Args, CxtI);
15981598

0 commit comments

Comments
 (0)