[PATCH] D33186: [InstCombine] Canonicalize clamp of float types to minmax in fast mode.

Andrei Elovikov via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon May 22 03:32:44 PDT 2017


a.elovikov added a comment.

In https://reviews.llvm.org/D33186#760622, @jmolloy wrote:

> Why wouldn't you state that they are custom lowered, and copy the generic bailout code from SelectionDAGBuilder.cpp if "nnan" isn't set?


If I understand correctly, making that "custom" would have negative impact in the presence of nans because cmp/select sequence would be turned to min/max+cmp(for nans)+select. And I have not seen the cases where lowering is set to custom due to global fast math flags. Is that really an option?

One option can be to check for nnan flags in *both* SelectionDagBuilder and combineSelect but that would add an implicit dependency between them which does not look right.
And splitting it into two


https://reviews.llvm.org/D33186





More information about the llvm-commits mailing list