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

via llvm-commits llvm-commits at lists.llvm.org
Wed Jan 31 07:45:44 PST 2024


k-arrows wrote:

> Does this pattern exist in some real-world applications?

Probably no, so I won't insist on this pattern if there is no particular benefit. I remember clang was sometimes suboptimal for expressions which contain `(a < 0)`. (See https://github.com/llvm/llvm-project/issues/67916 https://github.com/llvm/llvm-project/issues/63751 https://github.com/llvm/llvm-project/issues/62586 for example.) This fold was probably found around the same time as these.

By the way, shouldn't we at least change the title of this PR? Now we're dealing with something more general.

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


More information about the llvm-commits mailing list