[InstCombine] Canonicalize "and, add", "or, add", "xor, add"
Canonicalize ``` ((x + C1) & C2) --> ((x & C2) + C1) ((x + C1) ^ C2) --> ((x ^ C2) + C1) ((x + C1) | C2) --> ((x | C2) + C1) ``` for suitable constants `C1` and `C2`. Alive2 proofs: [[ https://alive2.llvm.org/ce/z/BqMDVZ | add, or --> or, add ]] [[ https://alive2.llvm.org/ce/z/BhAeCl | add, xor --> xor, add ]] [[ https://alive2.llvm.org/ce/z/jYRHEt | add, and --> and, add ]] Reviewed By: spatel Differential Revision: https://reviews.llvm.org/D131142
Loading
Please sign in to comment