Skip to content

Commit 56abb8d

Browse files
committed
[AArch64] Be stricter about insert/extract index
Post-commit fixup patch for a request on #81135
1 parent 16f2a1f commit 56abb8d

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

llvm/lib/Target/AArch64/AArch64TargetTransformInfo.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -600,9 +600,9 @@ AArch64TTIImpl::getIntrinsicInstrCost(const IntrinsicCostAttributes &ICA,
600600
TargetLoweringBase::LegalizeKind VecLK =
601601
getTLI()->getTypeConversion(C, VecVT);
602602
const Value *Idx = IsExtract ? ICA.getArgs()[1] : ICA.getArgs()[2];
603-
const ConstantInt *CIdx = dyn_cast<ConstantInt>(Idx);
603+
const ConstantInt *CIdx = cast<ConstantInt>(Idx);
604604
if (SubVecLK.first == TargetLoweringBase::TypeLegal &&
605-
VecLK.first == TargetLoweringBase::TypeLegal && CIdx && CIdx->isZero())
605+
VecLK.first == TargetLoweringBase::TypeLegal && CIdx->isZero())
606606
return TTI::TCC_Free;
607607
break;
608608
}

0 commit comments

Comments
 (0)