Skip to content

Commit ae58cc0

Browse files
authored
IVDescriptors: clarify getSCEV use in a function (NFC) (#106222)
getSCEV will assert unless the operand is SCEVable. Replace an instance of the implementation of ScalarEvolution::isSCEVable (which checks that the operand is either integer or pointer type) with a call to the function, to make it clear that the subsequent use of getSCEV will not fail.
1 parent 0359b9a commit ae58cc0

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

llvm/lib/Analysis/IVDescriptors.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1479,8 +1479,8 @@ bool InductionDescriptor::isInductionPHI(
14791479
InductionDescriptor &D, const SCEV *Expr,
14801480
SmallVectorImpl<Instruction *> *CastsToIgnore) {
14811481
Type *PhiTy = Phi->getType();
1482-
// We only handle integer and pointer inductions variables.
1483-
if (!PhiTy->isIntegerTy() && !PhiTy->isPointerTy())
1482+
// isSCEVable returns true for integer and pointer types.
1483+
if (!SE->isSCEVable(PhiTy))
14841484
return false;
14851485

14861486
// Check that the PHI is consecutive.

0 commit comments

Comments
 (0)