This is an archive of the discontinued LLVM Phabricator instance.

[LICM] Allow freeze to hoist/sink out of a loop
ClosedPublic

Authored by aqjune on Feb 28 2020, 10:22 PM.

Details

Summary

This patch allows LICM to hoist/sink freeze instructions out of a loop.

Diff Detail

Event Timeline

aqjune created this revision.Feb 28 2020, 10:22 PM
lebedev.ri added inline comments.
llvm/lib/Transforms/Scalar/LICM.cpp
1235–1237

Should there be a standalone test for this?

aqjune edited the summary of this revision. (Show Details)EditedFeb 29 2020, 5:05 AM

There was a confusion about the meaning of sink - I thought it was about moving an instruction from outside of the loop to inside.
freeze is allowed to move from inside to outside of a loop, including both hoist and sink.
I added a test for sink too.

aqjune marked an inline comment as done.Feb 29 2020, 5:07 AM
aqjune updated this revision to Diff 247468.Feb 29 2020, 2:50 PM

Clang-format

aqjune retitled this revision from [LICM] Allow freeze to hoist out of a loop to [LICM] Allow freeze to hoist/sink out of a loop.Feb 29 2020, 2:55 PM
aqjune edited the summary of this revision. (Show Details)
aqjune added a comment.Mar 1 2020, 5:19 PM

This is a small change - may I land this patch?

reames accepted this revision.Mar 2 2020, 12:30 PM

LGTM

This revision is now accepted and ready to land.Mar 2 2020, 12:30 PM
This revision was automatically updated to reflect the committed changes.