This is an archive of the discontinued LLVM Phabricator instance.

guard fneg with fmf sub flags
ClosedPublic

Authored by mcberg2017 on May 25 2018, 1:00 PM.

Details

Summary

This change uses fmf subflags to guard optimizations as well as unsafe. These changes originated from D46483.

Diff Detail

Repository
rL LLVM

Event Timeline

mcberg2017 created this revision.May 25 2018, 1:00 PM
mcberg2017 updated this revision to Diff 149873.EditedJun 4 2018, 4:43 PM
mcberg2017 retitled this revision from guard sqrt, fneg and cmp optimizations with fmf sub flags to guard sqrt with fmf sub flags.

This review only contains one context, namely fneg. Please comment if needed, otherwise perhaps we can proceed.

mcberg2017 retitled this revision from guard sqrt with fmf sub flags to guard fneg with fmf sub flags.Jun 4 2018, 4:46 PM
spatel added inline comments.Jun 5 2018, 6:19 AM
lib/CodeGen/SelectionDAG/SelectionDAG.cpp
4054 ↗(On Diff #149873)

The FIXME comment is stale, and it should be removed.

The fneg does have FMF to propagate, but we're not doing that here, and that's a mistake visible in the test case.

test/CodeGen/PowerPC/fmf-propagation.ll
39–49 ↗(On Diff #149873)

Please add this test as an NFC preliminary commit. That way, we won't have the constant pool noise in the unrelated tests. You might also just want to put this test at the bottom of the file to avoid that noise.

Cleanup up code. Move test to bottom of lit test file, staged initial fneg_fsub test and checked in, with modifications here.

spatel accepted this revision.Jun 5 2018, 11:44 AM

There's still an open question about why we're doing folds like this in getNode(), but I guess we'll answer that in another patch.

LGTM.

This revision is now accepted and ready to land.Jun 5 2018, 11:44 AM
This revision was automatically updated to reflect the committed changes.