Skip to content

Commit cffff30

Browse files
committed
fixup! Address review comments
1 parent 25a49c9 commit cffff30

File tree

5 files changed

+8
-9
lines changed

5 files changed

+8
-9
lines changed

llvm/include/llvm/Analysis/VectorUtils.h

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -189,8 +189,9 @@ LLVM_ABI unsigned getInterleaveIntrinsicFactor(Intrinsic::ID ID);
189189
/// Returns the corresponding factor of llvm.vector.deinterleaveN intrinsics.
190190
LLVM_ABI unsigned getDeinterleaveIntrinsicFactor(Intrinsic::ID ID);
191191

192-
/// Given a deinterleaveN intrinsic, return the (narrow) type of each factor.
193-
LLVM_ABI Type *getDeinterleavedVectorType(IntrinsicInst *DI);
192+
/// Given a deinterleaveN intrinsic, return the (narrow) vector type of each
193+
/// factor.
194+
LLVM_ABI VectorType *getDeinterleavedVectorType(IntrinsicInst *DI);
194195

195196
/// Given a vector and an element number, see if the scalar value is
196197
/// already around as a register, for example if it were inserted then extracted

llvm/lib/Analysis/VectorUtils.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -306,13 +306,13 @@ unsigned llvm::getDeinterleaveIntrinsicFactor(Intrinsic::ID ID) {
306306
}
307307
}
308308

309-
Type *llvm::getDeinterleavedVectorType(IntrinsicInst *DI) {
309+
VectorType *llvm::getDeinterleavedVectorType(IntrinsicInst *DI) {
310310
[[maybe_unused]] unsigned Factor =
311311
getDeinterleaveIntrinsicFactor(DI->getIntrinsicID());
312312
ArrayRef<Type *> DISubtypes = DI->getType()->subtypes();
313313
assert(Factor && Factor == DISubtypes.size() &&
314314
"unexpected deinterleave factor or result type");
315-
return DISubtypes[0];
315+
return cast<VectorType>(DISubtypes[0]);
316316
}
317317

318318
/// Given a vector and an element number, see if the scalar value is

llvm/lib/CodeGen/InterleavedAccessPass.cpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -624,8 +624,7 @@ bool InterleavedAccessImpl::lowerDeinterleaveIntrinsic(
624624
return false;
625625
// Check mask operand. Handle both all-true/false and interleaved mask.
626626
Value *WideMask = VPLoad->getOperand(1);
627-
Mask = getMask(WideMask, Factor,
628-
cast<VectorType>(getDeinterleavedVectorType(DI)));
627+
Mask = getMask(WideMask, Factor, getDeinterleavedVectorType(DI));
629628
if (!Mask)
630629
return false;
631630

llvm/lib/Target/AArch64/AArch64ISelLowering.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17497,7 +17497,7 @@ bool AArch64TargetLowering::lowerDeinterleaveIntrinsicToLoad(
1749717497
return false;
1749817498
assert(!Mask && "Unexpected mask on a load\n");
1749917499

17500-
VectorType *VTy = cast<VectorType>(getDeinterleavedVectorType(DI));
17500+
VectorType *VTy = getDeinterleavedVectorType(DI);
1750117501

1750217502
const DataLayout &DL = LI->getModule()->getDataLayout();
1750317503
bool UseScalable;

llvm/lib/Target/RISCV/RISCVInterleavedAccess.cpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -259,13 +259,12 @@ static bool isMultipleOfN(const Value *V, const DataLayout &DL, unsigned N) {
259259
bool RISCVTargetLowering::lowerDeinterleaveIntrinsicToLoad(
260260
Instruction *Load, Value *Mask, IntrinsicInst *DI) const {
261261
const unsigned Factor = getDeinterleaveIntrinsicFactor(DI->getIntrinsicID());
262-
assert(Factor && "unexpected deinterleaving factor");
263262
if (Factor > 8)
264263
return false;
265264

266265
IRBuilder<> Builder(Load);
267266

268-
VectorType *ResVTy = cast<VectorType>(getDeinterleavedVectorType(DI));
267+
VectorType *ResVTy = getDeinterleavedVectorType(DI);
269268

270269
const DataLayout &DL = Load->getDataLayout();
271270
auto *XLenTy = Type::getIntNTy(Load->getContext(), Subtarget.getXLen());

0 commit comments

Comments
 (0)