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) {
13251325// icmp eq 0, (and num, val - 1)
13261326// For value being power of two
13271327Instruction *InstCombinerImpl::foldIsMultipleOfAPowerOfTwo (ICmpInst &Cmp) {
1328- Value *Op0 = Cmp.getOperand (0 ), *Op1 = Cmp.getOperand (1 );
13291328 Value *Neg, *Num, *Mask, *Value;
13301329 CmpPredicate Pred;
13311330 const APInt *NegConst, *MaskConst;
13321331
13331332 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))))))
13371336 return nullptr ;
13381337
13391338 if (!ICmpInst::isEquality (Pred))
@@ -1364,9 +1363,6 @@ Instruction *InstCombinerImpl::foldIsMultipleOfAPowerOfTwo(ICmpInst &Cmp) {
13641363 return nullptr ;
13651364 }
13661365
1367- if (!match (Op0, m_Specific (Num)) && !match (Op1, m_Specific (Num)))
1368- return nullptr ;
1369-
13701366 // Create new icmp eq (num & (val - 1)), 0
13711367 auto NewAnd = Builder.CreateAnd (Num, Mask);
13721368 auto Zero = llvm::Constant::getNullValue (Num->getType ());
You can’t perform that action at this time.
0 commit comments