This is an archive of the discontinued LLVM Phabricator instance.

[Scalarizer] Propagate IR flags
ClosedPublic

Authored by foad on Jun 20 2019, 3:32 AM.

Details

Summary

The motivation for this was to propagate fast-math flags like nnan and
ninf on vector floating point operations to the corresponding scalar
operations to take advantage of follow-on optimizations. But I think
the same argument applies to all of our IR flags: if they apply to the
vector operation then they also apply to all the individual scalar
operations, and they might enable follow-on optimizations.

Event Timeline

foad created this revision.Jun 20 2019, 3:32 AM
Herald added a project: Restricted Project. · View Herald TranscriptJun 20 2019, 3:32 AM
sheredom accepted this revision.Jun 20 2019, 5:09 AM
This revision is now accepted and ready to land.Jun 20 2019, 5:09 AM
foad requested review of this revision.Jun 20 2019, 5:29 AM

Hoping for review from someone outside AMD.

arsenm added inline comments.Jun 20 2019, 5:43 AM
llvm/test/Transforms/Scalarizer/basic.ll
531

Can you also add a test for fneg, and an intrinsic or 2

foad updated this revision to Diff 205818.Jun 20 2019, 8:13 AM

Add fneg test.

foad marked an inline comment as done.Jun 20 2019, 8:14 AM
foad added inline comments.
llvm/test/Transforms/Scalarizer/basic.ll
531

fneg: done. Intrinsics are CallInsts which don't have any IR flags.

arsenm added inline comments.Jun 20 2019, 8:31 AM
llvm/test/Transforms/Scalarizer/basic.ll
531

Yes they do. Also, fcmp is another strange case to test

foad updated this revision to Diff 205891.Jun 20 2019, 1:24 PM

Add fcmp and intrinsic tests.

foad marked 3 inline comments as done.Jun 20 2019, 1:25 PM
foad added inline comments.
llvm/test/Transforms/Scalarizer/basic.ll
531

Good point. Done.

arsenm accepted this revision.Jun 21 2019, 6:41 AM

LGTM

This revision is now accepted and ready to land.Jun 21 2019, 6:41 AM
This revision was automatically updated to reflect the committed changes.
foad marked an inline comment as done.