This is an archive of the discontinued LLVM Phabricator instance.

Remove LoopID metadata from the branch instruction that follows the peeled iterations.
ClosedPublic

Authored by vzakhari on Sep 17 2018, 9:55 AM.

Details

Summary

This change removes LoopID metadata from the branch instruction created for the peeled iterations. It just improves LLVM IR readability after the loop peeling, e.g. the branch instructions belonging to the peel code are not marked with metadata making it clear that they are not loop latch branches anymore.

Diff Detail

Repository
rL LLVM

Event Timeline

vzakhari created this revision.Sep 17 2018, 9:55 AM
vzakhari updated this revision to Diff 165879.Sep 17 2018, 6:42 PM

Updated diff with the context.

mkazantsev added a comment.EditedSep 17 2018, 8:01 PM
This comment has been deleted.
test/Transforms/LoopUnroll/peel-loop-conditions.ll
41

I guess what you need here is something like CHECK-NOT: loop1...?

mkazantsev accepted this revision.Sep 17 2018, 8:03 PM

LGTM, but please add CHECK-NOT into test to make sure that the metadata is actually dropped.

This revision is now accepted and ready to land.Sep 17 2018, 8:03 PM
vzakhari added inline comments.Sep 18 2018, 9:48 AM
test/Transforms/LoopUnroll/peel-loop-conditions.ll
41

If there is "!llvm.loop !{{.*}}" in this line, then FOR_END will contain it, so it will not pass CHECK-NEXT at line 62 below. At the same time, I agree that more robust checking may be done here, so I will update the tests shortly.

vzakhari updated this revision to Diff 166001.Sep 18 2018, 10:49 AM
This revision was automatically updated to reflect the committed changes.