Skip to content

Commit c267928

Browse files
committed
[RISCV][IA] Use getIntNTy routines on builder to simplify code [nfc]
Addressing a suggestion from #149605 consistently throughout file.
1 parent eb55412 commit c267928

File tree

1 file changed

+6
-9
lines changed

1 file changed

+6
-9
lines changed

llvm/lib/Target/RISCV/RISCVInterleavedAccess.cpp

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -204,7 +204,7 @@ bool RISCVTargetLowering::lowerInterleavedLoad(
204204

205205
const DataLayout &DL = Load->getDataLayout();
206206
auto *VTy = cast<FixedVectorType>(Shuffles[0]->getType());
207-
auto *XLenTy = Type::getIntNTy(Load->getContext(), Subtarget.getXLen());
207+
auto *XLenTy = Builder.getIntNTy(Subtarget.getXLen());
208208

209209
Value *Ptr, *VL;
210210
Align Alignment;
@@ -277,7 +277,7 @@ bool RISCVTargetLowering::lowerInterleavedStore(Instruction *Store,
277277
// Given SVI : <n*factor x ty>, then VTy : <n x ty>
278278
auto *VTy = FixedVectorType::get(ShuffleVTy->getElementType(),
279279
ShuffleVTy->getNumElements() / Factor);
280-
auto *XLenTy = Type::getIntNTy(Store->getContext(), Subtarget.getXLen());
280+
auto *XLenTy = Builder.getIntNTy(Subtarget.getXLen());
281281

282282
Value *Ptr, *VL;
283283
Align Alignment;
@@ -351,7 +351,7 @@ bool RISCVTargetLowering::lowerDeinterleaveIntrinsicToLoad(
351351
VectorType *ResVTy = getDeinterleavedVectorType(DI);
352352

353353
const DataLayout &DL = Load->getDataLayout();
354-
auto *XLenTy = Type::getIntNTy(Load->getContext(), Subtarget.getXLen());
354+
auto *XLenTy = Builder.getIntNTy(Subtarget.getXLen());
355355

356356
Value *Ptr, *VL;
357357
Align Alignment;
@@ -372,8 +372,7 @@ bool RISCVTargetLowering::lowerDeinterleaveIntrinsicToLoad(
372372
unsigned NumElts = ResVTy->getElementCount().getKnownMinValue();
373373
Type *VecTupTy = TargetExtType::get(
374374
Load->getContext(), "riscv.vector.tuple",
375-
ScalableVectorType::get(Type::getInt8Ty(Load->getContext()),
376-
NumElts * SEW / 8),
375+
ScalableVectorType::get(Builder.getInt8Ty(), NumElts * SEW / 8),
377376
Factor);
378377
Function *VlsegNFunc = Intrinsic::getOrInsertDeclaration(
379378
Load->getModule(), ScalableVlsegIntrIds[Factor - 2],
@@ -414,7 +413,7 @@ bool RISCVTargetLowering::lowerInterleaveIntrinsicToStore(
414413

415414
auto *InVTy = cast<VectorType>(InterleaveValues[0]->getType());
416415
const DataLayout &DL = Store->getDataLayout();
417-
Type *XLenTy = Type::getIntNTy(Store->getContext(), Subtarget.getXLen());
416+
Type *XLenTy = Builder.getIntNTy(Subtarget.getXLen());
418417

419418
Value *Ptr, *VL;
420419
Align Alignment;
@@ -438,9 +437,7 @@ bool RISCVTargetLowering::lowerInterleaveIntrinsicToStore(
438437
unsigned NumElts = InVTy->getElementCount().getKnownMinValue();
439438
Type *VecTupTy = TargetExtType::get(
440439
Store->getContext(), "riscv.vector.tuple",
441-
ScalableVectorType::get(Type::getInt8Ty(Store->getContext()),
442-
NumElts * SEW / 8),
443-
Factor);
440+
ScalableVectorType::get(Builder.getInt8Ty(), NumElts * SEW / 8), Factor);
444441

445442
Value *StoredVal = PoisonValue::get(VecTupTy);
446443
for (unsigned i = 0; i < Factor; ++i)

0 commit comments

Comments
 (0)