[PATCH] D42406: Utils: Fix DomTree update for entry block

Davide Italiano via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Jan 23 07:51:44 PST 2018


davide added inline comments.


================
Comment at: lib/Transforms/Utils/BasicBlockUtils.cpp:508
+
+    if (DT && BB == DT->getRootNode()->getBlock())
+      DT->setNewRoot(NewBB);
----------------
kuhar wrote:
> Shouldn't this be handled in `UpdateAnalysisInformation`?
> I think that it would also make sense to assert that BB used to be the first BB in the function -- this would only fire when someone passed in an already incorrect DomTree. Otherwise, this can hide this kind of bugs.
agree with Kuba


https://reviews.llvm.org/D42406





More information about the llvm-commits mailing list