[CGP] Remove ModifiedDT from the makeBitReverse loop
authorCraig Topper <craig.topper@intel.com>
Mon, 19 Aug 2019 18:02:24 +0000 (18:02 +0000)
committerCraig Topper <craig.topper@intel.com>
Mon, 19 Aug 2019 18:02:24 +0000 (18:02 +0000)
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.

Differential Revision: https://reviews.llvm.org/D66366

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@369283 91177308-0d34-0410-b5e6-96231b3b80d8

lib/CodeGen/CodeGenPrepare.cpp

index 7da810c40c48f987c4ad7c105c5c8b4e980ece3f..c6edbb90e000c8e7523d2bc0d83c587228cd0e12 100644 (file)
@@ -7104,7 +7104,6 @@ bool CodeGenPrepare::optimizeBlock(BasicBlock &BB, bool &ModifiedDT) {
     for (auto &I : reverse(BB)) {
       if (makeBitReverse(I, *DL, *TLI)) {
         MadeBitReverse = MadeChange = true;
-        ModifiedDT = true;
         break;
       }
     }