diff options
| author | Eric Christopher <echristo@gmail.com> | 2015-08-19 02:15:13 +0000 |
|---|---|---|
| committer | Eric Christopher <echristo@gmail.com> | 2015-08-19 02:15:13 +0000 |
| commit | 0efe9f60bb7ca3b3cbfe2f8046070ebd65753068 (patch) | |
| tree | 7e9f2fdefeb484fdca0d3a5d89891e3a440f45fd /llvm/test/Transforms/DeadStoreElimination | |
| parent | c62c6396103c30a49f7e9cb0fa3ba657816c77ba (diff) | |
| download | bcm5719-llvm-0efe9f60bb7ca3b3cbfe2f8046070ebd65753068.tar.gz bcm5719-llvm-0efe9f60bb7ca3b3cbfe2f8046070ebd65753068.zip | |
Revert "Fix PR24469 resulting from r245025 and re-enable dead store elimination across basicblocks."
This is causing bootstrap problems, e.g.: http://bb.pgr.jp/builders/clang-3stage-i686-linux/builds/2960
This reverts r245195.
llvm-svn: 245402
Diffstat (limited to 'llvm/test/Transforms/DeadStoreElimination')
| -rw-r--r-- | llvm/test/Transforms/DeadStoreElimination/cross_block_dse.ll | 104 | ||||
| -rw-r--r-- | llvm/test/Transforms/DeadStoreElimination/cross_block_dse_loop.ll | 104 |
2 files changed, 0 insertions, 208 deletions
diff --git a/llvm/test/Transforms/DeadStoreElimination/cross_block_dse.ll b/llvm/test/Transforms/DeadStoreElimination/cross_block_dse.ll deleted file mode 100644 index dfab8554559..00000000000 --- a/llvm/test/Transforms/DeadStoreElimination/cross_block_dse.ll +++ /dev/null @@ -1,104 +0,0 @@ -; RUN: opt < %s -basicaa -dse -S | FileCheck %s -target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128" - -@x = common global i32 0 -@y = common global i32 0 -@a = external global i32 -@b = external global i32 - -define void @test_01(i32 %N) { - %1 = alloca i32 - store i32 %N, i32* %1 - store i32 10, i32* @x - %2 = load i32, i32* %1 - %3 = icmp ne i32 %2, 0 - br i1 %3, label %4, label %5 - -; <label>:4 - store i32 5, i32* @x - br label %5 - -; <label>:5 - store i32 15, i32* @x - ret void -} -; CHECK-LABEL: @test_01( -; CHECK-NOT: store i32 10, i32* @x -; CHECK-NOT: store i32 5, i32* @x -; CHECK: store i32 15, i32* @x - - -define void @test_02(i32 %N) { - %1 = alloca i32 - store i32 %N, i32* %1 - store i32 10, i32* @x - %2 = load i32, i32* %1 - %3 = icmp ne i32 %2, 0 - br i1 %3, label %4, label %5 - -; <label>:4 - store i32 5, i32* @x - br label %7 - -; <label>:5 - %6 = load i32, i32* @x - store i32 %6, i32* @y - br label %7 - -; <label>:7 - store i32 15, i32* @x - ret void -} -; CHECK-LABEL: @test_02( -; CHECK: store i32 10, i32* @x -; CHECK-NOT: store i32 5, i32* @x -; CHECK: store i32 %6, i32* @y - - -define void @test_03(i32 %N) #0 { - %1 = alloca i32 - store i32 %N, i32* %1 - store i32 10, i32* @x - %2 = load i32, i32* %1 - %3 = icmp ne i32 %2, 0 - br i1 %3, label %4, label %6 - -; <label>:4 ; preds = %0 - %5 = load i32, i32* @x - store i32 %5, i32* @y - br label %6 - -; <label>:6 ; preds = %4, %0 - store i32 15, i32* @x - ret void -} -; CHECK-LABEL: @test_03( -; CHECK: store i32 10, i32* @x -; CHECK: store i32 %5, i32* @y -; CHECK: store i32 15, i32* @x - - - -; Check we safely delete store i32 %g.02, i32* @b below.(PR24469) -define void @test_04() { -entry: - br i1 false, label %for.body, label %for.end.9 - -for.cond.1.loopexit: ; preds = %for.body - store i32 0, i32* @b - %0 = load i32, i32* @a - br i1 false, label %for.body, label %for.end.9 - -for.body: ; preds = %for.cond.1.loopexit, %entry - %g.02 = phi i32 [ undef, %entry ], [ %0, %for.cond.1.loopexit ] - store i32 %g.02, i32* @b - br label %for.cond.1.loopexit - -for.end.9: ; preds = %for.cond.1.loopexit, %entry - ret void -} - -; CHECK-LABEL: @test_04( -; CHECK-NOT: store i32 %g.02, i32* @b -; CHECK-NOT: %g.02 = phi i32 [ undef, %entry ], [ %0, %for.cond.1.loopexit ] -; CHECK-NOT: %0 = load i32, i32* @a diff --git a/llvm/test/Transforms/DeadStoreElimination/cross_block_dse_loop.ll b/llvm/test/Transforms/DeadStoreElimination/cross_block_dse_loop.ll deleted file mode 100644 index 769a561b664..00000000000 --- a/llvm/test/Transforms/DeadStoreElimination/cross_block_dse_loop.ll +++ /dev/null @@ -1,104 +0,0 @@ -; RUN: opt < %s -basicaa -dse -S | FileCheck %s -target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128" - -@A = common global [100 x i32] zeroinitializer, align 16 -@x = common global i32 0 - -; Negative Test case- -;void foo(int N) { -; A[0] = N; -; for(int i=0;i<N;++i) -; A[i]+=i; -; A[0] = 10; -;} -;; Stores should not be optimized away. - -define void @test_01(i32 %N) #0 { - %1 = alloca i32 - %i = alloca i32 - store i32 %N, i32* %1 - %2 = load i32, i32* %1 - store i32 %2, i32* getelementptr inbounds ([100 x i32], [100 x i32]* @A, i32 0, i64 0) - store i32 0, i32* %i - br label %3 - -; <label>:3 ; preds = %14, %0 - %4 = load i32, i32* %i - %5 = load i32, i32* %1 - %6 = icmp slt i32 %4, %5 - br i1 %6, label %7, label %17 - -; <label>:7 ; preds = %3 - %8 = load i32, i32* %i - %9 = load i32, i32* %i - %10 = sext i32 %9 to i64 - %11 = getelementptr inbounds [100 x i32], [100 x i32]* @A, i32 0, i64 %10 - %12 = load i32, i32* %11 - %13 = add nsw i32 %12, %8 - store i32 %13, i32* %11 - br label %14 - -; <label>:14 ; preds = %7 - %15 = load i32, i32* %i - %16 = add nsw i32 %15, 1 - store i32 %16, i32* %i - br label %3 - -; <label>:17 ; preds = %3 - store i32 10, i32* getelementptr inbounds ([100 x i32], [100 x i32]* @A, i32 0, i64 0) - ret void -} -; CHECK-LABEL: @test_01( -; CHECK: store i32 %2, i32* getelementptr inbounds ([100 x i32], [100 x i32]* @A, i32 0, i64 0) -; CHECK: store i32 %13, i32* %11 -; CHECK: store i32 10, i32* getelementptr inbounds ([100 x i32], [100 x i32]* @A, i32 0, i64 0) - - -; Postive Test case- -;void foo(int N) { -; A[0] = N; -; for(int i=0;i<N;++i) -; A[i]=i; -; A[0] = 10; -;} -;; Stores should not be optimized away. -define void @test_02(i32 %N) #0 { - %1 = alloca i32 - %i = alloca i32 - store i32 %N, i32* %1 - %2 = load i32, i32* %1 - store i32 %2, i32* getelementptr inbounds ([100 x i32], [100 x i32]* @A, i32 0, i64 0) - store i32 0, i32* %i - br label %3 - -; <label>:3 ; preds = %12, %0 - %4 = load i32, i32* %i - %5 = load i32, i32* %1 - %6 = icmp slt i32 %4, %5 - br i1 %6, label %7, label %15 - -; <label>:7 ; preds = %3 - %8 = load i32, i32* %i - %9 = load i32, i32* %i - %10 = sext i32 %9 to i64 - %11 = getelementptr inbounds [100 x i32], [100 x i32]* @A, i32 0, i64 %10 - store i32 %8, i32* %11 - br label %12 - -; <label>:12 ; preds = %7 - %13 = load i32, i32* %i - %14 = add nsw i32 %13, 1 - store i32 %14, i32* %i - br label %3 - -; <label>:15 ; preds = %3 - store i32 10, i32* getelementptr inbounds ([100 x i32], [100 x i32]* @A, i32 0, i64 0) - ret void -} - -; CHECK-LABEL: @test_02( -; CHECK-NOT: store i32 %2, i32* getelementptr inbounds ([100 x i32], [100 x i32]* @A, i32 0, i64 0) -; CHECK: store i32 %7, i32* %10 -; CHECK: store i32 10, i32* getelementptr inbounds ([100 x i32], [100 x i32]* @A, i32 0, i64 0) - - |

