This is an archive of the discontinued LLVM Phabricator instance.

[LoopSimplifyCFG] Form LCSSA when a parent loop becomes a sibling
ClosedPublic

Authored by mkazantsev on Dec 28 2018, 9:14 PM.

Details

Summary

During the transforms in LoopSimplifyCFG, when we remove a dead exiting edge, the
parent loop may stop being reachable from the child loop, and therefore they become
siblings. If the former child loop had uses of some values from its former parent loop,
now such uses will require LCSSA Phis, even if they weren't needed before. So we must
form LCSSA for all loops that stopped being ancestors of the current loop in this case.

Diff Detail

Event Timeline

mkazantsev created this revision.Dec 28 2018, 9:14 PM
mkazantsev edited the summary of this revision. (Show Details)
uabelho resigned from this revision.Jan 2 2019, 2:36 AM

The problem I saw goes away with this patch and I haven't seen any new failures with the limited testing I've done on the patch. Thanks!
I don't know this code though, so I don't know if this is the way the problem should be solved.

mkazantsev added a reviewer: asbirlea.

Re-uploaded with context.

This revision is now accepted and ready to land.Jan 16 2019, 3:26 AM
This revision was automatically updated to reflect the committed changes.