This is an archive of the discontinued LLVM Phabricator instance.

[OpenMPIRBuilder] Implicitly defined control blocks. NFC.
ClosedPublic

Authored by Meinersbur on Nov 22 2021, 7:12 AM.

Details

Summary

Do not explicitly store the BasicBlocks for Preheader, Body and After inside CanonicalLoopInfo, but look the up when needed using their position relative to the other loop control blocks. By definition, instructions inside these are not managed by CanonicalLoopInfo (except terminator for Preheader) hence it makes sense to think of them as connections to the CanonicalLoopInfo instead of part of the CanonicalLoopInfo itself.

In particular for Preheader, it makes using SplitBasicBlock easier since inserting control flow at an InsertPoint may otherwise require updating the CanonicalLoopInfo's Preheader because the branch that jumps to the header is moved to another BasicBlock.

Diff Detail