This is an archive of the discontinued LLVM Phabricator instance.

FixIrreducible: don't crash when moving a child loop
ClosedPublic

Authored by sameerds on Apr 21 2020, 1:23 AM.

Details

Summary

When an irreducible SCC is converted into a new natural loop, existing
loops included in that SCC now become children of the new loop. The
logic that moves these loops from the parent loop to the new loop
invoked undefined behaviour when it modified the container that it was
iterating over. Fixed this by first extracting all the loops that are
to be removed from the parent.

Fixes bug 45623.

Diff Detail

Event Timeline

sameerds created this revision.Apr 21 2020, 1:23 AM
Herald added a project: Restricted Project. · View Herald TranscriptApr 21 2020, 1:23 AM
sameerds updated this revision to Diff 258923.Apr 21 2020, 1:25 AM

Added bug ID to the commit description

sameerds edited the summary of this revision. (Show Details)Apr 21 2020, 1:27 AM
sameerds added reviewers: arsenm, kripken, gkistanova.
sameerds updated this revision to Diff 258932.Apr 21 2020, 2:07 AM

clang-format

arsenm added inline comments.Apr 21 2020, 7:29 AM
llvm/test/Transforms/FixIrreducible/bug45623.ll
3

Don't need to specify the default check prefix

5–7

Can remove these

8

Does the triple matter? If so it belongs in a wasm test directory?

97

Is this really needed?

sameerds updated this revision to Diff 259018.Apr 21 2020, 8:56 AM

review comments

sameerds marked 4 inline comments as done.Apr 21 2020, 8:57 AM
arsenm accepted this revision.Apr 21 2020, 10:04 AM
This revision is now accepted and ready to land.Apr 21 2020, 10:04 AM
This revision was automatically updated to reflect the committed changes.