[llvm] [llvm][InstCombine] Fold signum(x) into scmp(x, 0) (PR #143445)

Nikita Popov via llvm-commits llvm-commits at lists.llvm.org
Thu Jun 12 13:08:27 PDT 2025


https://github.com/nikic commented:

We have a getFlippedStrictnessPredicateAndConstant() helper for cases like this. I think we can handle this generically by doing a swap of the select arms to get the constant into TV, inverting the predicate, and then using getFlippedStrictnessPredicateAndConstant() to convert the now non-strict predicate into a strict predicate. 

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


More information about the llvm-commits mailing list