Revert "[SimplifyCFG] Add a workaround to fix PR30188"
authorJames Molloy <james.molloy@arm.com>
Wed, 31 Aug 2016 13:16:36 +0000 (13:16 +0000)
committerJames Molloy <james.molloy@arm.com>
Wed, 31 Aug 2016 13:16:36 +0000 (13:16 +0000)
This reverts commit r280219. r280216 caused buildbot failures - backing out the entire chain.

llvm-svn: 280232

llvm/lib/Transforms/Utils/SimplifyCFG.cpp
llvm/test/Transforms/SimplifyCFG/sink-common-code.ll

index 3de6c60..3404a4d 100644 (file)
@@ -1424,16 +1424,6 @@ static bool canSinkInstructions(
         // FIXME: if the call was *already* indirect, we should do this.
         return false;
       }
-      // Because SROA can't handle speculating stores of selects, try not
-      // to sink stores of allocas when we'd have to create a PHI for the
-      // address operand.
-      // FIXME: This is a workaround for a deficiency in SROA - see
-      // https://llvm.org/bugs/show_bug.cgi?id=30188
-      if (OI == 1 && isa<StoreInst>(I0) &&
-          any_of(Insts, [](const Instruction *I) {
-            return isa<AllocaInst>(I->getOperand(1));
-          }))
-        return false;
       for (auto *I : Insts)
         PHIOperands[I].push_back(I->getOperand(OI));
     }
index 9f87d3b..1a4884a 100644 (file)
@@ -537,29 +537,6 @@ if.end:
 ; CHECK-DAG: [ %cmp3, %if.then3 ]
 ; CHECK-NEXT: zext i1 %[[x]] to i8
 
-define i32 @test_pr30188(i1 zeroext %flag, i32 %x) {
-entry:
-  %y = alloca i32
-  %z = alloca i32
-  br i1 %flag, label %if.then, label %if.else
-
-if.then:
-  store i32 %x, i32* %y
-  br label %if.end
-
-if.else:
-  store i32 %x, i32* %z
-  br label %if.end
-
-if.end:
-  ret i32 1
-}
-
-; CHECK-LABEL: test_pr30188
-; CHECK-NOT: select
-; CHECK: store
-; CHECK: store
-
 ; CHECK: !0 = !{!1, !1, i64 0}
 ; CHECK: !1 = !{!"float", !2}
 ; CHECK: !2 = !{!"an example type tree"}