[llvm] [InstCombine] Add folds for (icmp eq/ne (and (add/sub/xor A, P2), P2), 0/P2) (PR #67836)

via llvm-commits llvm-commits at lists.llvm.org
Sat Oct 28 10:20:18 PDT 2023


goldsteinn wrote:

> Just to double check: Is there real world motivation for this pattern? As this is a multi-use-only pattern, we should not handle it without specific motivation. (As you can imagine, you can construct a huge number of multi-use-only patterns by combining any number of use-restricted patterns.)

Motivation case was essentially odd-even pattern where noticed the cmp was happen after the increment/decrement. The `sub`/`xor` + `P2` form was just to cover the general pattern.

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


More information about the llvm-commits mailing list