[PATCH] D71516: [InstCombine] Canonicalize select immediates

Dave Green via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Dec 17 14:47:29 PST 2019


dmgreen added a comment.

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? 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.


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

https://reviews.llvm.org/D71516





More information about the llvm-commits mailing list