[PATCH] D92200: Ensure SplitEdge to return the new block between the two given blocks
Hongtao Yu via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Fri Nov 27 11:31:15 PST 2020
hoy added inline comments.
================
Comment at: llvm/lib/Transforms/Utils/BasicBlockUtils.cpp:512
assert(SP == BB && "CFG broken");
SP = nullptr;
+ return SplitBlock(Succ, &Succ->front(), DT, LI, MSSAU, "", /*Before=*/true);
----------------
Nit: Is resetting `SP` still needed?
================
Comment at: llvm/lib/Transforms/Utils/BasicBlockUtils.cpp:595
+ if (DT) {
+ DomTreeUpdater DTU(DT, DomTreeUpdater::UpdateStrategy::Lazy);
+ SmallVector<DominatorTree::UpdateType, 8> DTUpdates;
----------------
Can we just change the dominator tree edges directly instead of going through the dominator updater?
like
```
OldIdom = OldNode->getIDom();
DT->changeImmediateDominator(OldNode, NewNode);
DT->changeImmediateDominator(NewNode, OldIdom)
```
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D92200/new/
https://reviews.llvm.org/D92200
More information about the llvm-commits
mailing list