File tree Expand file tree Collapse file tree 1 file changed +4
-4
lines changed
llvm/lib/Transforms/InstCombine Expand file tree Collapse file tree 1 file changed +4
-4
lines changed Original file line number Diff line number Diff line change @@ -1320,10 +1320,10 @@ Instruction *InstCombinerImpl::foldICmpWithZero(ICmpInst &Cmp) {
13201320 return nullptr ;
13211321}
13221322
1323- // / Fold icmp eq (num + (val - 1)) & -val , num
1323+ // / Fold icmp eq (num + mask) & ~mask , num
13241324// / to
1325- // / icmp eq (and num, val - 1 ), 0
1326- // / For val being power of two
1325+ // / icmp eq (and num, mask ), 0
1326+ // / Where mask is a low bit mask.
13271327Instruction *InstCombinerImpl::foldIsMultipleOfAPowerOfTwo (ICmpInst &Cmp) {
13281328 Value *Num;
13291329 CmpPredicate Pred;
@@ -1342,7 +1342,7 @@ Instruction *InstCombinerImpl::foldIsMultipleOfAPowerOfTwo(ICmpInst &Cmp) {
13421342 if (!ICmpInst::isEquality (Pred))
13431343 return nullptr ;
13441344
1345- // Create new icmp eq (num & (val - 1) ), 0
1345+ // Create new icmp eq (num & mask ), 0
13461346 auto *NewAnd = Builder.CreateAnd (Num, *Mask);
13471347 auto *Zero = Constant::getNullValue (Num->getType ());
13481348
You can’t perform that action at this time.
0 commit comments