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

Jakub Kuderski via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Jan 22 19:53:21 PST 2018


kuhar added inline comments.


================
Comment at: lib/Transforms/Utils/BasicBlockUtils.cpp:508
+
+    if (DT && BB == DT->getRootNode()->getBlock())
+      DT->setNewRoot(NewBB);
----------------
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.


https://reviews.llvm.org/D42406





More information about the llvm-commits mailing list