[llvm-commits] [llvm] r84672 - in /llvm/trunk/test/Transforms/SCCP: ipsccp-basic.ll ipsccp-conditional.ll ipsccp-gvar.ll
Chris Lattner
sabre at nondot.org
Tue Oct 20 13:39:44 PDT 2009
Author: lattner
Date: Tue Oct 20 15:39:43 2009
New Revision: 84672
URL: http://llvm.org/viewvc/llvm-project?rev=84672&view=rev
Log:
merge and filecheckize
Removed:
llvm/trunk/test/Transforms/SCCP/ipsccp-conditional.ll
llvm/trunk/test/Transforms/SCCP/ipsccp-gvar.ll
Modified:
llvm/trunk/test/Transforms/SCCP/ipsccp-basic.ll
Modified: llvm/trunk/test/Transforms/SCCP/ipsccp-basic.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Transforms/SCCP/ipsccp-basic.ll?rev=84672&r1=84671&r2=84672&view=diff
==============================================================================
--- llvm/trunk/test/Transforms/SCCP/ipsccp-basic.ll (original)
+++ llvm/trunk/test/Transforms/SCCP/ipsccp-basic.ll Tue Oct 20 15:39:43 2009
@@ -1,13 +1,74 @@
-; RUN: opt < %s -ipsccp -S | \
-; RUN: grep -v {ret i32 17} | grep -v {ret i32 undef} | not grep ret
+; RUN: opt < %s -ipsccp -S | FileCheck %s
-define internal i32 @bar(i32 %A) {
- %X = add i32 1, 2 ; <i32> [#uses=0]
+;;======================== test1
+
+define internal i32 @test1a(i32 %A) {
+ %X = add i32 1, 2
ret i32 %A
}
+; CHECK: define internal i32 @test1a
+; CHECK: ret i32 undef
+
+define i32 @test1b() {
+ %X = call i32 @test1a( i32 17 )
+ ret i32 %X
+
+; CHECK: define i32 @test1b
+; CHECK: ret i32 17
+}
+
+
+
+;;======================== test2
+
+define internal i32 @test2a(i32 %A) {
+ %C = icmp eq i32 %A, 0
+ br i1 %C, label %T, label %F
+T:
+ %B = call i32 @test2a( i32 0 )
+ ret i32 0
+F:
+ %C.upgrd.1 = call i32 @test2a(i32 1)
+ ret i32 %C.upgrd.1
+}
+; CHECK: define internal i32 @test2a
+; CHECK-NEXT: br label %T
+; CHECK: ret i32 undef
+
-define i32 @foo() {
- %X = call i32 @bar( i32 17 ) ; <i32> [#uses=1]
+define i32 @test2b() {
+ %X = call i32 @test2a(i32 0)
ret i32 %X
}
+; CHECK: define i32 @test2b
+; CHECK-NEXT: %X = call i32 @test2a(i32 0)
+; CHECK-NEXT: ret i32 0
+
+
+;;======================== test3
+
+ at G = internal global i32 undef
+define void @test3a() {
+ %X = load i32* @G
+ store i32 %X, i32* @G
+ ret void
+}
+; CHECK: define void @test3a
+; CHECK-NEXT: ret void
+
+
+define i32 @test3b() {
+ %V = load i32* @G
+ %C = icmp eq i32 %V, 17
+ br i1 %C, label %T, label %F
+T:
+ store i32 17, i32* @G
+ ret i32 %V
+F:
+ store i32 123, i32* @G
+ ret i32 0
+}
+; CHECK: define i32 @test3b
+; CHECK-NOT: store
+; CHECK: ret i32 0
Removed: llvm/trunk/test/Transforms/SCCP/ipsccp-conditional.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Transforms/SCCP/ipsccp-conditional.ll?rev=84671&view=auto
==============================================================================
--- llvm/trunk/test/Transforms/SCCP/ipsccp-conditional.ll (original)
+++ llvm/trunk/test/Transforms/SCCP/ipsccp-conditional.ll (removed)
@@ -1,19 +0,0 @@
-; RUN: opt < %s -ipsccp -S | \
-; RUN: grep -v {ret i32 0} | grep -v {ret i32 undef} | not grep ret
-
-define internal i32 @bar(i32 %A) {
- %C = icmp eq i32 %A, 0 ; <i1> [#uses=1]
- br i1 %C, label %T, label %F
-T: ; preds = %0
- %B = call i32 @bar( i32 0 ) ; <i32> [#uses=0]
- ret i32 0
-F: ; preds = %0
- %C.upgrd.1 = call i32 @bar( i32 1 ) ; <i32> [#uses=1]
- ret i32 %C.upgrd.1
-}
-
-define i32 @foo() {
- %X = call i32 @bar( i32 0 ) ; <i32> [#uses=1]
- ret i32 %X
-}
-
Removed: llvm/trunk/test/Transforms/SCCP/ipsccp-gvar.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Transforms/SCCP/ipsccp-gvar.ll?rev=84671&view=auto
==============================================================================
--- llvm/trunk/test/Transforms/SCCP/ipsccp-gvar.ll (original)
+++ llvm/trunk/test/Transforms/SCCP/ipsccp-gvar.ll (removed)
@@ -1,22 +0,0 @@
-; RUN: opt < %s -ipsccp -S | not grep global
-
- at G = internal global i32 undef ; <i32*> [#uses=5]
-
-define void @foo() {
- %X = load i32* @G ; <i32> [#uses=1]
- store i32 %X, i32* @G
- ret void
-}
-
-define i32 @bar() {
- %V = load i32* @G ; <i32> [#uses=2]
- %C = icmp eq i32 %V, 17 ; <i1> [#uses=1]
- br i1 %C, label %T, label %F
-T: ; preds = %0
- store i32 17, i32* @G
- ret i32 %V
-F: ; preds = %0
- store i32 123, i32* @G
- ret i32 0
-}
-
More information about the llvm-commits
mailing list