[llvm] [InstCombine] Simplify a complex OR to XOR (PR #75129)

Nikita Popov via llvm-commits llvm-commits at lists.llvm.org
Wed Dec 13 02:58:56 PST 2023


nikic wrote:

@Peter9606 We'd probably approach that as a demanded bits transform (https://github.com/llvm/llvm-project/blob/d293a354d076c772ccd2972a71cb4a7d6f9aa410/llvm/lib/Transforms/InstCombine/InstCombineSimplifyDemanded.cpp#L492). Convert `X + C` to `X ^ C` if `C` is equal to the top bit of the `DemandedMask`.

https://github.com/llvm/llvm-project/pull/75129


More information about the llvm-commits mailing list