This is an archive of the discontinued LLVM Phabricator instance.

[IRCE] Avoid loop optimizations on pre and post loops
ClosedPublic

Authored by anna on Nov 17 2016, 10:26 AM.

Details

Summary

This patch will add loop metadata on the pre and post loops generated by IRCE.
Currently, we have metadata for disabling optimizations such as vectorization,
unrolling, loop distribution and LICM versioning (and confirmed that these
optimizations check for the metadata before proceeding with the transformation).

The pre and post loops generated by IRCE need not go through loop opts (since
these are slow paths).

I have tried this on some of the test cases in IRCE to make sure that the
metadata is added to pre/post loops. Will add test case once confirmed that this
is the right path forward.

Diff Detail

Repository
rL LLVM

Event Timeline

anna updated this revision to Diff 78384.Nov 17 2016, 10:26 AM
anna retitled this revision from to [IRCE] Avoid loop optimizations on pre and post loops.
anna updated this object.
anna added reviewers: sanjoy, reames.
anna added a subscriber: llvm-commits.
sanjoy accepted this revision.Dec 11 2016, 7:42 PM
sanjoy edited edge metadata.

lgtm with a test case and an inline comment

lib/Transforms/Scalar/InductiveRangeCheckElimination.cpp
427 ↗(On Diff #78384)

I'd structure this a little differently -- I'd avoid the SmallVector and instead do:

MDNode *NewLoopID = MDNode::get(Context, {DisableUnroll, DisableVectorize, DisableLICMVersioning ...});
This revision is now accepted and ready to land.Dec 11 2016, 7:42 PM
This revision was automatically updated to reflect the committed changes.
anna marked an inline comment as done.Dec 13 2016, 1:16 PM

Added a test case as well

lib/Transforms/Scalar/InductiveRangeCheckElimination.cpp
427 ↗(On Diff #78384)

Updated.