This is an archive of the discontinued LLVM Phabricator instance.

Bug 21610: Canonicalize min/max fcmp selects to use ordered comparisons
ClosedPublic

Authored by arsenm on Nov 20 2014, 1:03 AM.

Details

Reviewers
scanon
hfinkel

Diff Detail

Event Timeline

arsenm updated this revision to Diff 16419.Nov 20 2014, 1:03 AM
arsenm updated this revision to Diff 16420.
arsenm retitled this revision from to Bug 21610: Canonicalize min/max fcmp selects to use ordered comparisons .
arsenm updated this object.
arsenm edited the test plan for this revision. (Show Details)
arsenm added reviewers: hfinkel, scanon.
arsenm added a subscriber: Unknown Object (MLST).

Attach correct patch

hfinkel edited edge metadata.Nov 20 2014, 7:30 PM

What's the motivation?

In D6337#6, @hfinkel wrote:

What's the motivation?

To reduce the number of cases to inspect when looking at something that looks like a min / max. I was working on matching some different versions of min and max instructions with varying NaN behavior, and kept writing patterns permuting the operands for the different cases. Plus in the bug I noticed the temporary variable changed the IR, so this seems like a basic missing canonicalization. Also ordered compares are more 'normal' and seem to be more popular and understood in the backends, so it seems preferable to us them when possible.

hfinkel accepted this revision.Nov 20 2014, 10:18 PM
hfinkel edited edge metadata.

Thanks, LGTM.

test/Transforms/InstCombine/unordered-fcmp-select.ll
127 ↗(On Diff #16420)

Please remove unnecessary attributes.

This revision is now accepted and ready to land.Nov 20 2014, 10:18 PM
arsenm closed this revision.Nov 24 2014, 3:15 PM

r222705