This is an archive of the discontinued LLVM Phabricator instance.

[InstCombine] Preserve fast math flags when combining PHIs
ClosedPublic

Authored by sbaranga on Apr 21 2016, 9:23 AM.

Details

Summary

When optimizing PHIs which have inputs floating point binary
operators, we preserve all IR flags except the fast math
flags.

This change removes the logic which tracked some of the IR flags
(no wrap, exact) and replaces it by doing an and on the IR flags of
all inputs to the PHI - which will also handle the fast math
flags.

Diff Detail

Event Timeline

sbaranga updated this revision to Diff 54518.Apr 21 2016, 9:23 AM
sbaranga retitled this revision from to [InstCombine] Preserve fast math flags when combining PHIs.
sbaranga updated this object.
sbaranga added a reviewer: majnemer.
sbaranga added a subscriber: llvm-commits.
majnemer accepted this revision.Apr 21 2016, 11:07 AM
majnemer edited edge metadata.

Nice, LGTM with nits.

test/Transforms/InstCombine/phi-preserve-ir-flags.ll
6

I'd add a little more for the labels, something like:

; CHECK-LABEL: define float @f(
This revision is now accepted and ready to land.Apr 21 2016, 11:07 AM
sbaranga updated this revision to Diff 54631.Apr 22 2016, 4:26 AM
sbaranga edited edge metadata.

Check a longer string when performing label checks.

sbaranga closed this revision.Apr 22 2016, 4:27 AM

Thanks! Committed in r267139