[PATCH] D37343: [CGP] Merge empty case blocks if no extra moves are added.

Balaram Makam via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Sep 28 20:38:39 PDT 2017


bmakam added inline comments.


================
Comment at: lib/CodeGen/CodeGenPrepare.cpp:713
 
+    if (DT && ModifiedDT) {
+      DT->recalculate(F);
----------------
bmakam wrote:
> efriedma wrote:
> > This usage of "ModifiedDT" is weird; if the CFG is ever modified, you recompute every time you visit a basic blocK?
> In some corner cases [1], the entry block is removed and dominator tree cannot be notified of this change.  In such cases we will have to recalculate the entire tree. This was primarily the reason why I was lazily computing DT earlier. Please let me know if there is a better way to handle this.
> [1] test/Transforms/CodeGenPrepare/2008-11-24-RAUW-Self.ll
It seems like r314435 has taken care of this corner case in MergeBasicBlockIntoOnlyPred. So we can now simply pass DT to MergeBasicBlockIntoOnlyPred. I will rebase and update the patch.


https://reviews.llvm.org/D37343





More information about the llvm-commits mailing list