Skip to content

Commit 497f793

Browse files
committed
Update InstCombineShifts.cpp
1 parent aa257b2 commit 497f793

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

llvm/lib/Transforms/InstCombine/InstCombineShifts.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1411,7 +1411,7 @@ Instruction *InstCombinerImpl::visitLShr(BinaryOperator &I) {
14111411

14121412
const APInt *MulC;
14131413
if (match(Op0, m_NUWMul(m_Value(X), m_APInt(MulC)))) {
1414-
if ((*MulC - 1).isPowerOf2() && MulC->logBase2() == ShAmtC && BitWidth > 2) {
1414+
if (BitWidth > 2 && (*MulC - 1).isPowerOf2() && MulC->logBase2() == ShAmtC) {
14151415
// Look for a "splat" mul pattern - it replicates bits across each half
14161416
// of a value, so a right shift is just a mask of the low bits:
14171417
// lshr i[2N] (mul nuw X, (2^N)+1), N --> and iN X, (2^N)-1

0 commit comments

Comments
 (0)