Skip to content

Commit 19ae5af

Browse files
committed
!fixup use logBase2.
1 parent 2d050bf commit 19ae5af

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

llvm/lib/Analysis/ScalarEvolution.cpp

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3220,11 +3220,12 @@ const SCEV *ScalarEvolution::getMulExpr(SmallVectorImpl<const SCEV *> &Ops,
32203220
// D is a multiple of C2, and C1 is a multiple of C1.
32213221
const SCEV *D;
32223222
const SCEVConstant *C2;
3223-
if (LHSC->getAPInt().isPowerOf2() &&
3223+
APInt LHSV = LHSC->getAPInt();
3224+
if (LHSV.isPowerOf2() &&
32243225
match(Ops[1], m_scev_UDiv(m_SCEV(D), m_SCEVConstant(C2))) &&
32253226
C2->getAPInt().isPowerOf2() &&
3226-
getMinTrailingZeros(LHSC) >= getMinTrailingZeros(C2) &&
3227-
getMinTrailingZeros(LHSC) <= getMinTrailingZeros(D)) {
3227+
LHSV.logBase2() >= C2->getAPInt().logBase2() &&
3228+
LHSV.logBase2() <= getMinTrailingZeros(D)) {
32283229
return getMulExpr(getUDivExpr(LHSC, C2), D);
32293230
}
32303231
}

0 commit comments

Comments
 (0)