From: Michael Zolotukhin Date: Sat, 6 Aug 2016 01:48:51 +0000 (+0000) Subject: Revert "[LoopSimplify] Fix updating LCSSA after separating nested loops." X-Git-Tag: llvmorg-4.0.0-rc1~13167 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=09cf304ebc3c75b32f919065e9f32b4fbef590ac;p=platform%2Fupstream%2Fllvm.git Revert "[LoopSimplify] Fix updating LCSSA after separating nested loops." This reverts commit r277877. Try to appease clang-x64-ninja-win7 buildbot. llvm-svn: 277901 --- diff --git a/llvm/lib/Transforms/Utils/LoopSimplify.cpp b/llvm/lib/Transforms/Utils/LoopSimplify.cpp index fc5781f..2846e8f 100644 --- a/llvm/lib/Transforms/Utils/LoopSimplify.cpp +++ b/llvm/lib/Transforms/Utils/LoopSimplify.cpp @@ -376,21 +376,6 @@ static Loop *separateNestedLoop(Loop *L, BasicBlock *Preheader, } } } - // We also need to check exit blocks of the outer loop - it might be using - // values from what now became an inner loop. - SmallVector ExitBlocks; - NewOuter->getExitBlocks(ExitBlocks); - for (BasicBlock *ExitBB: ExitBlocks) { - for (Instruction &I : *ExitBB) { - for (Value *Op : I.operands()) { - Instruction *OpI = dyn_cast(Op); - if (!OpI || !L->contains(OpI)) - continue; - WorklistSet.insert(OpI); - } - } - } - SmallVector Worklist(WorklistSet.begin(), WorklistSet.end()); formLCSSAForInstructions(Worklist, *DT, *LI); diff --git a/llvm/test/Transforms/LoopSimplify/pr28272.ll b/llvm/test/Transforms/LoopSimplify/pr28272.ll index e59d763..49990f9 100644 --- a/llvm/test/Transforms/LoopSimplify/pr28272.ll +++ b/llvm/test/Transforms/LoopSimplify/pr28272.ll @@ -1,7 +1,7 @@ ; RUN: opt < %s -lcssa -loop-unroll -S | FileCheck %s target triple = "x86_64-unknown-linux-gnu" -; PR28272, PR28825 +; PR28272 ; When LoopSimplify separates nested loops, it might break LCSSA form: values ; from the original loop might be used in the outer loop. This test invokes ; loop-unroll, which calls loop-simplify before itself. If LCSSA is broken @@ -74,35 +74,3 @@ loop2.if.false: bb: br label %loop2 } - -; When LoopSimplify separates nested loops, it might break LCSSA form: values -; from the original loop might be used in exit blocks of the outer loop. -; CHECK-LABEL: @foo3 -define void @foo3() { -entry: - br label %bb1 - -bb1: - br i1 undef, label %bb2, label %bb1 - -bb2: - %a = phi i32 [ undef, %bb1 ], [ %a, %bb3 ], [ undef, %bb5 ] - br i1 undef, label %bb3, label %bb1 - -bb3: - %b = load i32*, i32** undef - br i1 undef, label %bb2, label %bb4 - -bb4: - br i1 undef, label %bb5, label %bb6 - -bb5: - br i1 undef, label %bb2, label %bb4 - -bb6: - br i1 undef, label %bb_end, label %bb1 - -bb_end: - %x = getelementptr i32, i32* %b - br label %bb_end -}