[PATCH] D71516: [InstCombine] Canonicalize select immediates

Roman Lebedev via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Dec 17 14:56:41 PST 2019


lebedev.ri accepted this revision.
lebedev.ri added a comment.

In D71516#1788713 <https://reviews.llvm.org/D71516#1788713>, @dmgreen wrote:

> Code that triggers this is actually used a lot in one library I was looking at.
>  It's quite a big gain for both scalar and vector code to make sure this is matched correctly.
>  (That's CMSISDSP, the same one that I was quoting differences from in the
>  "bump select threshold to 3" patch. Interestingly it would only manifest some of the time,
>  if inlining would happen before instead of after some simplification I think).
>
> Does the "original" testcase shows the issue in enough detail?
>  That's roughly what is happening. Or the example in the summary?




In D71516#1788713 <https://reviews.llvm.org/D71516#1788713>, @dmgreen wrote:

> They are not min/max patterns like they should be, and nothing will recognize them as such.
>  Including ISel but also any of the code we have to attempt not split apart min/max patterns.
>
> There's almost certainly a dozen different ways to fix this,
>  but I think this one makes sense; canonicalising the select immediates towards the icmp values.


Okay, that answered the question.
Sounds good, thank you.


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

https://reviews.llvm.org/D71516





More information about the llvm-commits mailing list