[PATCH] D145772: [Instcombine] Canonicalize all <=> patterns to (a>b)-(a<b)

Nikita Popov via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Mar 10 01:46:29 PST 2023


nikic added a comment.

I think it's long overdue to canonicalize three-way comparisons in some way. Looking at asm for different backends, it does look like this representation is pretty much universally better than the select form. I'm less sure whether this is ideal for middle-end optimization.

Something I'm wondering is whether it might make sense to recognize this as a first-class pattern and actually introduce an `iN @llvm.compare.iN.iM(iM %a, iM %b)` intrinsic for this purpose.


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D145772/new/

https://reviews.llvm.org/D145772



More information about the llvm-commits mailing list