[PATCH] D66366: [CGP] Remove ModifiedDT from the makeBitReverse loop

Craig Topper via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Aug 16 13:39:19 PDT 2019


craig.topper created this revision.
craig.topper added reviewers: spatel, george.burgess.iv, efriedma.
Herald added a subscriber: hiraditya.
Herald added a project: LLVM.

I don't think anything in this loop modifies the control flow and we don't restart any iteration after setting the flag.

This code was added in http://reviews.llvm.org/D16893 but looking at the test case added there the code that caused the dominator tree to change was merging blocks with their predecessor not the bitreverse optimization.


https://reviews.llvm.org/D66366

Files:
  llvm/lib/CodeGen/CodeGenPrepare.cpp


Index: llvm/lib/CodeGen/CodeGenPrepare.cpp
===================================================================
--- llvm/lib/CodeGen/CodeGenPrepare.cpp
+++ llvm/lib/CodeGen/CodeGenPrepare.cpp
@@ -7103,7 +7103,6 @@
     for (auto &I : reverse(BB)) {
       if (makeBitReverse(I, *DL, *TLI)) {
         MadeBitReverse = MadeChange = true;
-        ModifiedDT = true;
         break;
       }
     }


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D66366.215665.patch
Type: text/x-patch
Size: 396 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20190816/ea3498bf/attachment.bin>


More information about the llvm-commits mailing list