Page MenuHomePhabricator

GVN: propagate fcmp equalities (PR17713)
ClosedPublic

Authored by spatel on Jan 9 2015, 5:08 PM.

Details

Summary

Patch based on suggestion in PR17713 ( http://llvm.org/bugs/show_bug.cgi?id=17713 ) and discussion in http://lists.cs.uiuc.edu/pipermail/llvmdev/2015-January/080314.html .

This just handles the simple case of propagating FP values along edges; there are still a lot of other cases (eg http://llvm.org/bugs/show_bug.cgi?id=17683 ) that need work.

Diff Detail

Repository
rL LLVM

Event Timeline

spatel updated this revision to Diff 17963.Jan 9 2015, 5:08 PM
spatel retitled this revision from to GVN: propagate fcmp equalities (PR17713).
spatel updated this object.
spatel edited the test plan for this revision. (Show Details)
spatel added reviewers: reames, pete, ArchDRobison, hfinkel.
spatel added a subscriber: Unknown Object (MLST).
ArchDRobison edited edge metadata.Jan 12 2015, 7:44 AM

Looks correct to me. (The minimalist in me asks if there is a shorter way to write 2.000000e+00?)

  • Arch

Looks correct to me. (The minimalist in me asks if there is a shorter way to write 2.000000e+00?)

Thanks, Arch! I can change the IR inputs to plain "2.0", but I'm not aware of a way to change the output (CHECK) formatting.

pete added inline comments.Jan 12 2015, 10:02 AM
lib/Transforms/Scalar/GVN.cpp
2188 ↗(On Diff #17963)

I think you need a test case which verifies (positive and negative) cases of a floating point compare here. Looks like a ugt can prove an ole is false for example.

The rest of the changes LGTM if you add tests for these.

spatel updated this revision to Diff 18031.Jan 12 2015, 11:16 AM
spatel edited edge metadata.

Added test cases for other FP comparisons. Tests based on existing integer tests.
Minimized IR: "2.00000+00" --> "2.0".

pete accepted this revision.Jan 12 2015, 11:21 AM
pete edited edge metadata.

Thanks. LGTM

This revision is now accepted and ready to land.Jan 12 2015, 11:21 AM
This revision was automatically updated to reflect the committed changes.

Thanks, Pete! Checked in at r225660.