This is an archive of the discontinued LLVM Phabricator instance.

[InstCombine] intersect FMF when reassociating FP min/max intrinsics
ClosedPublic

Authored by spatel on Apr 22 2020, 6:07 AM.

Details

Summary

As discussed in PR45478:
https://bugs.llvm.org/show_bug.cgi?id=45478
...propagating FMF from the outer (second) call is not correct, so intersect them instead.
I suspect we could do better (see TODO comment), but mismatched FMF is probably too rare to care about.

Diff Detail

Event Timeline

spatel created this revision.Apr 22 2020, 6:07 AM
spatel edited the summary of this revision. (Show Details)Apr 22 2020, 6:36 AM

Side note - Alive2 does not seem to recognize the keyword 'fast' currently (or we would have seen more tests flagged as incorrect).

nlopes added a subscriber: nlopes.Apr 22 2020, 7:39 AM

Side note - Alive2 does not seem to recognize the keyword 'fast' currently (or we would have seen more tests flagged as incorrect).

That's correct. Alive2 only supports a subset of 'fast', like ninf, nsz, nnan. Since 'fast' includes all of them, it can't be supported until we finish implementing the remaining fast-math flags.

liuz added a subscriber: liuz.Apr 22 2020, 8:08 AM
qiucf accepted this revision.Apr 22 2020, 7:55 PM

LGTM

This revision is now accepted and ready to land.Apr 22 2020, 7:55 PM
This revision was automatically updated to reflect the committed changes.
Herald added a project: Restricted Project. · View Herald TranscriptApr 24 2020, 9:43 AM