[PATCH] D70852: [InstCombine] Guard maxnum/minnum conversions with a TTI query

Roman Lebedev via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Nov 29 06:41:50 PST 2019


lebedev.ri added a comment.

In D70852#1763861 <https://reviews.llvm.org/D70852#1763861>, @uweigand wrote:

> In D70852#1763820 <https://reviews.llvm.org/D70852#1763820>, @lebedev.ri wrote:
>
> > This seems like a lowering problem in SystemZ backend.
>
>
> So is the backend supposed to lower minnum/maxnum always (to the obvious select sequence, I guess?), even if there's no instruction for it?   Why would that be the job of the backend?


Because it is a non-target-specific (i.e. not e.g. `@llvm.x86.`) llvm instruction.
They are considered canonical, and supposed to be handled by all backends,
even if via expansion into some other instructions.

For other examples, i think pretty much no backend has native `funnel shift`
(not rotate!) instruction, many don't have saturating math,
probably most don't have native fixed point math, not sure about strict-fp;
treating them as legal *in middle-end* only if particular backend supports
them is somewhat contrary to having canonical representation..


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

https://reviews.llvm.org/D70852





More information about the llvm-commits mailing list