- A & B_Pow2 != B_Pow2 -> A & B_Pow2 == 0 https://alive2.llvm.org/ce/z/KVUej4
- A & B_Pow2 == B_Pow2 -> A & B_Pow2 != 0 https://alive2.llvm.org/ce/z/PVv9FR
This allows the patterns to more easily be analyzed elsewhere.
Paths
| Differential D141090
[InstCombine] Canonicalize (A & B_Pow2) eq/ne B_Pow2 patterns ClosedPublic Authored by goldstein.w.n on Jan 5 2023, 2:25 PM.
Details Summary
This allows the patterns to more easily be analyzed elsewhere.
Diff Detail
Event Timelinegoldstein.w.n added a child revision: D140849: [InstCombine] Add tests for binops with conditions/assume constraints. Comment Actions LGTM Simpler proof: https://alive2.llvm.org/ce/z/JQMH7m Canonical pattern for pow2 check is ctpop==1.
This revision is now accepted and ready to land.Jan 6 2023, 1:08 AM spatel added inline comments.
goldstein.w.n marked an inline comment as done. Comment ActionsMake non-zero more clean
Comment Actions
Do you want me to update the commit message with link to this proof instead? Closed by commit rG6d839621da8d: [InstCombine] Canonicalize (A & B_Pow2) eq/ne B_Pow2 patterns (authored by goldstein.w.n, committed by nikic). · Explain WhyJan 9 2023, 3:48 AM This revision was automatically updated to reflect the committed changes.
Revision Contents
Diff 487376 llvm/lib/Transforms/InstCombine/InstCombineCompares.cpp
llvm/test/Transforms/InstCombine/icmp-and-shift.ll
|