This is an archive of the discontinued LLVM Phabricator instance.

[llvm][fix-irreducible] ensure that loop subtree under child is correctly reconnected to new loop
ClosedPublic

Authored by sunziping2016 on May 12 2022, 11:30 PM.

Details

Reviewers
sameerds
slarin
Summary

The modified function was incorrectly (not unnecessarily) ignoring grandchild loops, and this change fixes the bug. In particular, this fixes the handling of the loop { inner, body }. The TODO in the same function is talking about the b1 self loop, which may be "unnecessarily" lost, but that is a different issue.

Diff Detail

Event Timeline

sunziping2016 created this revision.May 12 2022, 11:30 PM
Herald added a project: Restricted Project. · View Herald TranscriptMay 12 2022, 11:30 PM
Herald added a subscriber: hiraditya. · View Herald Transcript
sunziping2016 requested review of this revision.May 12 2022, 11:30 PM
Herald added a project: Restricted Project. · View Herald TranscriptMay 12 2022, 11:30 PM
sameerds accepted this revision.May 17 2022, 10:23 PM

I think the change description is missing the point and needs to be rephrased. The modified function was incorrectly (not unnecessarily) ignoring grandchild loops, and this change fixes the bug. In particular, this fixes the handling of the loop { inner, body }. The TODO in the same function is talking about the b1 self loop, which may be "unnecessarily" lost, but that is a different issue.

A possible wording would be: "ensure that loop subtree under child is correctly reconnected to new loop"

This revision is now accepted and ready to land.May 17 2022, 10:23 PM
sunziping2016 retitled this revision from [llvm][fix-irreducible] FixIrreducible unnecessarily destroys child loops causing assertion error to [llvm][fix-irreducible] ensure that loop subtree under child is correctly reconnected to new loop.May 17 2022, 10:37 PM
sunziping2016 edited the summary of this revision. (Show Details)

I think the change description is missing the point and needs to be rephrased. The modified function was incorrectly (not unnecessarily) ignoring grandchild loops, and this change fixes the bug. In particular, this fixes the handling of the loop { inner, body }. The TODO in the same function is talking about the b1 self loop, which may be "unnecessarily" lost, but that is a different issue.

A possible wording would be: "ensure that loop subtree under child is correctly reconnected to new loop"

Sorry, I'm new here, so I know little about the workflows. I've just updated the title and the summary of this revision. I don't know whether you mean this. And I've noticed there is a build failure on x64 debian. Should I fix this?

Sorry, I'm new here, so I know little about the workflows. I've just updated the title and the summary of this revision. I don't know whether you mean this. And I've noticed there is a build failure on x64 debian. Should I fix this?

It is not enough to edit this revision in Phabricator (i.e., this web interface). You will need to amend the git commit in your worktree, because that's the one you will actually submit.

About the failure, I am not confident enough to say that you can ignore it. It is better if you ask on discourse.

update commit message

Sorry I missed this earlier. The name of the new test "issue55099.ll" doesn't really convey much information. It should be renamed to something more informative, like "preserve-child-loops.ll"

You don't have to upload a new patch here if you rename that file. Just make sure you rename it in your git commit before you do a "git push" to main branch.

Thanks for your patient and professional review. I think the x64 debian failure is related to my changes. I need to spend some time to fix the issue.

rename test file to a meaningful name