This is an archive of the discontinued LLVM Phabricator instance.

ValueTracking: Report fast math flags for fcmp/select
AbandonedPublic

Authored by arsenm on Sep 5 2018, 11:55 AM.

Details

Reviewers
spatel
efriedma

Diff Detail

Event Timeline

arsenm created this revision.Sep 5 2018, 11:55 AM

Is the root problem that we don't have FMF on any FP select? We discussed that in:
https://bugs.llvm.org/show_bug.cgi?id=38086

If that's correct, I think we should make that change instead of making matchSelectPattern more complicated.

We're going to have to fix this anyway to solve cases that aren't min/max like:
https://bugs.llvm.org/show_bug.cgi?id=39535

RKSimon added a subscriber: RKSimon.Jun 5 2019, 8:41 AM
RKSimon added inline comments.
include/llvm/IR/Operator.h
237

const FastMathFlags &OtherFlags ?

spatel added a comment.Jun 5 2019, 9:53 AM

Is the root problem that we don't have FMF on any FP select? We discussed that in:
https://bugs.llvm.org/show_bug.cgi?id=38086

If that's correct, I think we should make that change instead of making matchSelectPattern more complicated.

rL361401 - enabled FMF for select-of-FP, so I'm not sure where we stand on this patch. I'm also proposing to canonicalize to minnum/maxnum intrinsics from fcmp+select in D62414, so that might remove some of the motivation for this patch.

arsenm abandoned this revision.Sep 20 2019, 11:57 AM

Since select should have FMF now anyway, I don't think this is needed anymore

Since select should have FMF now anyway, I don't think this is needed anymore

Note: for IR coming from clang, we have to do more in most cases:
D67564