This is an archive of the discontinued LLVM Phabricator instance.

[CodeGen] Don't blindly combine (fp_round (fp_round x)) to (fp_round x).
ClosedPublic

Authored by ab on Feb 11 2015, 3:21 PM.

Details

Summary

Hi all,

Double-rounding and single-rounding can have different results, but we have a DAGCombine that turns the former into the latter.

I believe that's unsafe in the general case, but we can still do it:

  • if we know the first rounding is precise; or
  • if unsafe FP math is enabled.

-Ahmed

Diff Detail

Event Timeline

ab updated this revision to Diff 19787.Feb 11 2015, 3:21 PM
ab retitled this revision from to [CodeGen] Don't blindly combine (fp_round (fp_round x)) to (fp_round x)..
ab updated this object.
ab edited the test plan for this revision. (Show Details)
ab added subscribers: scanon, resistor, t.p.northover, mehdi_amini.
ab added a subscriber: Unknown Object (MLST).

+llvm-commits

ab updated this revision to Diff 19789.Feb 11 2015, 3:31 PM

.. and without the unused pointer in tests!

Good catch, the code looks good to me, but wait for someone else to sign off on it.

t.p.northover accepted this revision.Feb 11 2015, 6:21 PM
t.p.northover added a reviewer: t.p.northover.

Hi Ahmed,

The logic looks sound to me too. I think you should commit it.

Tim.

This revision is now accepted and ready to land.Feb 11 2015, 6:21 PM
This revision was automatically updated to reflect the committed changes.