[PATCH] D42406: Utils: Fix DomTree update for entry block
Matt Arsenault via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Wed Jan 31 14:55:44 PST 2018
arsenm added a comment.
In https://reviews.llvm.org/D42406#985160, @brzycki wrote:
> I too am curious how this managed to not be found for several years. @arsenm how did you discover this?
I'm working on a replacement for StructurizeCFG which needs to insert a block before certain blocks. Sometimes that ends up picking the entry block
================
Comment at: lib/Transforms/Utils/BasicBlockUtils.cpp:327
+ } else
+ DT->splitBlock(NewBB);
+ }
----------------
kuhar wrote:
> Without the patch, was the crash happening inside Split in `GenericDomTree.h`? If it doesn't support it, maybe it would make sense to assert in `DT->split` that `NewBB != getRootNode()` for (forward) dominators?
It was hitting
Assertion failed: (!PredBlocks.empty() && "No predblocks?"), function Split, file ../include/llvm/Support/GenericDomTree.h, line 808.
https://reviews.llvm.org/D42406
More information about the llvm-commits
mailing list