[llvm] [InstCombine] Fold selection between less than zero and one (PR #69961)

via llvm-commits llvm-commits at lists.llvm.org
Wed Jan 31 06:59:35 PST 2024


elhewaty wrote:

> @k-arrows @elhewaty Does this pattern exist in some real-world applications?

@dtcxzyw, I am not sure, but I think @XChy is the best to answer this, as he suggested to change
the pattern from `a ? (a < 0) : 1 --> (a <= 0)` to `A pred C ? (A >> BW - 1) : 1 -> ZExt(A pred C ? A < 0 : 1)`.

and [here](https://github.com/llvm/llvm-project/pull/69961#pullrequestreview-1694251097) @nikic said that he approved this pattern

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


More information about the llvm-commits mailing list