[llvm] 51932fc - [DSE, MemorySSA] Remove some duplicated test functions.

Florian Hahn via llvm-commits llvm-commits at lists.llvm.org
Fri Sep 4 09:54:30 PDT 2020


Author: Florian Hahn
Date: 2020-09-04T17:52:59+01:00
New Revision: 51932fc6bde88d1798a6cdea1f3885164d5524d7

URL: https://github.com/llvm/llvm-project/commit/51932fc6bde88d1798a6cdea1f3885164d5524d7
DIFF: https://github.com/llvm/llvm-project/commit/51932fc6bde88d1798a6cdea1f3885164d5524d7.diff

LOG: [DSE,MemorySSA] Remove some duplicated test functions.

Some tests from multibuild-malloc-free.ll do not actually use malloc or
free and where split out to multiblock-throwing.ll, but not removed from
the original file. This patch cleans that up. It also moves @test22 to
simple.ll, because it does not involve multiple blocks.

Added: 
    

Modified: 
    llvm/test/Transforms/DeadStoreElimination/MSSA/multiblock-malloc-free.ll
    llvm/test/Transforms/DeadStoreElimination/MSSA/multiblock-throwing.ll
    llvm/test/Transforms/DeadStoreElimination/MSSA/simple.ll

Removed: 
    


################################################################################
diff  --git a/llvm/test/Transforms/DeadStoreElimination/MSSA/multiblock-malloc-free.ll b/llvm/test/Transforms/DeadStoreElimination/MSSA/multiblock-malloc-free.ll
index 04cdae285d81..46712ccc92ff 100644
--- a/llvm/test/Transforms/DeadStoreElimination/MSSA/multiblock-malloc-free.ll
+++ b/llvm/test/Transforms/DeadStoreElimination/MSSA/multiblock-malloc-free.ll
@@ -84,31 +84,6 @@ bb3:
   ret void
 }
 
-
-define void @test6(i32* noalias %P) {
-; CHECK-LABEL: @test6(
-; CHECK-NEXT:    br i1 true, label [[BB1:%.*]], label [[BB2:%.*]]
-; CHECK:       bb1:
-; CHECK-NEXT:    br label [[BB3:%.*]]
-; CHECK:       bb2:
-; CHECK-NEXT:    call void @unknown_func()
-; CHECK-NEXT:    br label [[BB3]]
-; CHECK:       bb3:
-; CHECK-NEXT:    store i32 0, i32* [[P:%.*]]
-; CHECK-NEXT:    ret void
-;
-  store i32 0, i32* %P
-  br i1 true, label %bb1, label %bb2
-bb1:
-  br label %bb3
-bb2:
-  call void @unknown_func()
-  br label %bb3
-bb3:
-  store i32 0, i32* %P
-  ret void
-}
-
 define void @test19(i32* noalias %P) {
 ; CHECK-LABEL: @test19(
 ; CHECK-NEXT:  entry:
@@ -173,71 +148,6 @@ bb3:
   ret void
 }
 
-
-define i32 @test22(i32* %P, i32* noalias %Q, i32* %R) {
-; CHECK-LABEL: @test22(
-; CHECK-NEXT:    store i32 2, i32* [[P:%.*]]
-; CHECK-NEXT:    store i32 3, i32* [[Q:%.*]]
-; CHECK-NEXT:    [[L:%.*]] = load i32, i32* [[R:%.*]]
-; CHECK-NEXT:    ret i32 [[L]]
-;
-  store i32 1, i32* %Q
-  store i32 2, i32* %P
-  store i32 3, i32* %Q
-  %l = load i32, i32* %R
-  ret i32 %l
-}
-
-
-define void @test23(i32* noalias %P) {
-; CHECK-LABEL: @test23(
-; CHECK-NEXT:    br i1 true, label [[BB1:%.*]], label [[BB2:%.*]]
-; CHECK:       bb1:
-; CHECK-NEXT:    br label [[BB3:%.*]]
-; CHECK:       bb2:
-; CHECK-NEXT:    call void @unknown_func()
-; CHECK-NEXT:    br label [[BB3]]
-; CHECK:       bb3:
-; CHECK-NEXT:    store i32 0, i32* [[P:%.*]]
-; CHECK-NEXT:    ret void
-;
-  br i1 true, label %bb1, label %bb2
-bb1:
-  store i32 0, i32* %P
-  br label %bb3
-bb2:
-  call void @unknown_func()
-  br label %bb3
-bb3:
-  store i32 0, i32* %P
-  ret void
-}
-
-
-define void @test24(i32* noalias %P) {
-; CHECK-LABEL: @test24(
-; CHECK-NEXT:    br i1 true, label [[BB2:%.*]], label [[BB1:%.*]]
-; CHECK:       bb1:
-; CHECK-NEXT:    br label [[BB3:%.*]]
-; CHECK:       bb2:
-; CHECK-NEXT:    call void @unknown_func()
-; CHECK-NEXT:    br label [[BB3]]
-; CHECK:       bb3:
-; CHECK-NEXT:    store i32 0, i32* [[P:%.*]]
-; CHECK-NEXT:    ret void
-;
-  br i1 true, label %bb2, label %bb1
-bb1:
-  store i32 0, i32* %P
-  br label %bb3
-bb2:
-  call void @unknown_func()
-  br label %bb3
-bb3:
-  store i32 0, i32* %P
-  ret void
-}
-
 define i8* @test26() {
 ; CHECK-LABEL: @test26(
 ; CHECK-NEXT:  bb1:

diff  --git a/llvm/test/Transforms/DeadStoreElimination/MSSA/multiblock-throwing.ll b/llvm/test/Transforms/DeadStoreElimination/MSSA/multiblock-throwing.ll
index 93a9a2d999e1..d297ac3f44f8 100644
--- a/llvm/test/Transforms/DeadStoreElimination/MSSA/multiblock-throwing.ll
+++ b/llvm/test/Transforms/DeadStoreElimination/MSSA/multiblock-throwing.ll
@@ -30,21 +30,6 @@ bb3:
   ret void
 }
 
-define i32 @test22(i32* %P, i32* noalias %Q, i32* %R) {
-; CHECK-LABEL: @test22(
-; CHECK-NEXT:    store i32 2, i32* [[P:%.*]]
-; CHECK-NEXT:    store i32 3, i32* [[Q:%.*]]
-; CHECK-NEXT:    [[L:%.*]] = load i32, i32* [[R:%.*]]
-; CHECK-NEXT:    ret i32 [[L]]
-;
-  store i32 1, i32* %Q
-  store i32 2, i32* %P
-  store i32 3, i32* %Q
-  %l = load i32, i32* %R
-  ret i32 %l
-}
-
-
 define void @test23(i32* noalias %P) {
 ; CHECK-LABEL: @test23(
 ; CHECK-NEXT:    br i1 true, label [[BB1:%.*]], label [[BB2:%.*]]

diff  --git a/llvm/test/Transforms/DeadStoreElimination/MSSA/simple.ll b/llvm/test/Transforms/DeadStoreElimination/MSSA/simple.ll
index 5c04e11b4a78..1ac6ad7d8158 100644
--- a/llvm/test/Transforms/DeadStoreElimination/MSSA/simple.ll
+++ b/llvm/test/Transforms/DeadStoreElimination/MSSA/simple.ll
@@ -749,3 +749,17 @@ define void @test47_volatile(i32* %P) {
   store volatile i32 3, i32* %P, align 4
   ret void
 }
+
+define i32 @test48(i32* %P, i32* noalias %Q, i32* %R) {
+; CHECK-LABEL: @test48(
+; CHECK-NEXT:    store i32 2, i32* [[P:%.*]], align 4
+; CHECK-NEXT:    store i32 3, i32* [[Q:%.*]], align 4
+; CHECK-NEXT:    [[L:%.*]] = load i32, i32* [[R:%.*]], align 4
+; CHECK-NEXT:    ret i32 [[L]]
+;
+  store i32 1, i32* %Q
+  store i32 2, i32* %P
+  store i32 3, i32* %Q
+  %l = load i32, i32* %R
+  ret i32 %l
+}


        


More information about the llvm-commits mailing list