File tree Expand file tree Collapse file tree 1 file changed +3
-7
lines changed
llvm/lib/Transforms/InstCombine Expand file tree Collapse file tree 1 file changed +3
-7
lines changed Original file line number Diff line number Diff line change @@ -1325,15 +1325,14 @@ Instruction *InstCombinerImpl::foldICmpWithZero(ICmpInst &Cmp) {
1325
1325
// icmp eq 0, (and num, val - 1)
1326
1326
// For value being power of two
1327
1327
Instruction *InstCombinerImpl::foldIsMultipleOfAPowerOfTwo (ICmpInst &Cmp) {
1328
- Value *Op0 = Cmp.getOperand (0 ), *Op1 = Cmp.getOperand (1 );
1329
1328
Value *Neg, *Num, *Mask, *Value;
1330
1329
CmpPredicate Pred;
1331
1330
const APInt *NegConst, *MaskConst;
1332
1331
1333
1332
if (!match (&Cmp, m_c_ICmp (Pred, m_Value (Num),
1334
- m_OneUse (m_c_And (
1335
- m_OneUse ( m_c_Add ( m_Value (Num), m_Value (Mask))),
1336
- m_Value (Neg))))))
1333
+ m_OneUse (m_c_And (m_OneUse ( m_c_Add ( m_Deferred (Num),
1334
+ m_Value (Mask))),
1335
+ m_Value (Neg))))))
1337
1336
return nullptr ;
1338
1337
1339
1338
if (!ICmpInst::isEquality (Pred))
@@ -1364,9 +1363,6 @@ Instruction *InstCombinerImpl::foldIsMultipleOfAPowerOfTwo(ICmpInst &Cmp) {
1364
1363
return nullptr ;
1365
1364
}
1366
1365
1367
- if (!match (Op0, m_Specific (Num)) && !match (Op1, m_Specific (Num)))
1368
- return nullptr ;
1369
-
1370
1366
// Create new icmp eq (num & (val - 1)), 0
1371
1367
auto NewAnd = Builder.CreateAnd (Num, Mask);
1372
1368
auto Zero = llvm::Constant::getNullValue (Num->getType ());
You can’t perform that action at this time.
0 commit comments