[PATCH] D141090: [InstCombine] Canonicalize (A & B_Pow2) eq/ne B_Pow2 patterns
Nikita Popov via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Fri Jan 6 01:08:22 PST 2023
nikic accepted this revision.
nikic added a comment.
This revision is now accepted and ready to land.
LGTM
Simpler proof: https://alive2.llvm.org/ce/z/JQMH7m Canonical pattern for pow2 check is ctpop==1.
================
Comment at: llvm/lib/Transforms/InstCombine/InstCombineCompares.cpp:4791
+ if (match(Op0, m_c_And(m_Specific(Op1), m_Value())) &&
+ isKnownToBeAPowerOfTwo(Op1, false, 0, &I))
+ return new ICmpInst(CmpInst::getInversePredicate(Pred), Op0,
----------------
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D141090/new/
https://reviews.llvm.org/D141090
More information about the llvm-commits
mailing list