This is an archive of the discontinued LLVM Phabricator instance.

[LoopSink] Do not sink instructions into non-cold blocks
ClosedPublic

Authored by mgrang on Nov 6 2018, 1:16 PM.

Diff Detail

Event Timeline

mgrang created this revision.Nov 6 2018, 1:16 PM
rnk accepted this revision.Nov 6 2018, 1:50 PM

lgtm with some minor suggestions

lib/Transforms/Scalar/LoopSink.cpp
202

I'd do it after the empty check to put it closer to the lookup with .find below.

206

Maybe !LoopBlockNumber.count(BB)?

test/Transforms/LICM/loopsink-pr39570.ll
54

In the future, I recommend using creduce instead of bugpoint to reduce test cases like these. You will end up with a test that is much less fragile to changes in the way we fold undef.

This revision is now accepted and ready to land.Nov 6 2018, 1:50 PM
mgrang updated this revision to Diff 172874.Nov 6 2018, 3:49 PM

Addressed comments.

mgrang marked 2 inline comments as done.Nov 6 2018, 3:49 PM
This revision was automatically updated to reflect the committed changes.