This is an archive of the discontinued LLVM Phabricator instance.

propagate fast math flags via IR on fma and sub expressions
ClosedPublic

Authored by mcberg2017 on May 25 2018, 12:34 PM.

Details

Summary

This change uses fmf subflags to guard fma optimizations as well as unsafe. These changes originated from D46483 and have been simplified via getNode.

Diff Detail

Event Timeline

mcberg2017 created this revision.May 25 2018, 12:34 PM

Comments? These changes really only have two components. 1.) Adding flags to fma operations and their interior expressions when needed. 2.) extending fusing fma operations based on isContractable().

mcberg2017 updated this revision to Diff 150182.EditedJun 6 2018, 12:39 PM

This review now contains only 1 context, propagating flags onto FMA, it is in effect NFC. The next download will show some cleanup in the tests. The changes are flags only.
In a subsequent review I will extend FMA as earlier.

Thanks for splitting things up - that makes it a lot easier to make sure we're not introducing bugs.
This one is probably good to go, but I want to make sure I understand a couple of the test diffs.

test/CodeGen/PowerPC/fmf-propagation.ll
195

What's the intent of this diff? IIUC, the existing check isn't complete - we could check that there are both an fmul and fma both before and after this patch.

267

Same comment as above.

Some cleanup in the tests for FMFDEBUG

Adding context for FMFDEBUG to show both instructions in the matching

spatel accepted this revision.Jun 7 2018, 3:10 PM

LGTM.

This revision is now accepted and ready to land.Jun 7 2018, 3:10 PM
This revision was automatically updated to reflect the committed changes.