[llvm-commits] [llvm] r80521 - in /llvm/trunk/test/Transforms/LICM: 2003-12-13-VolatilePromote.ll scalar_promote.ll
Chris Lattner
sabre at nondot.org
Sun Aug 30 15:08:19 PDT 2009
Author: lattner
Date: Sun Aug 30 17:08:19 2009
New Revision: 80521
URL: http://llvm.org/viewvc/llvm-project?rev=80521&view=rev
Log:
convert scalar_promote to filecheck style and merge 2003-12-13-VolatilePromote.ll into it.
Removed:
llvm/trunk/test/Transforms/LICM/2003-12-13-VolatilePromote.ll
Modified:
llvm/trunk/test/Transforms/LICM/scalar_promote.ll
Removed: llvm/trunk/test/Transforms/LICM/2003-12-13-VolatilePromote.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Transforms/LICM/2003-12-13-VolatilePromote.ll?rev=80520&view=auto
==============================================================================
--- llvm/trunk/test/Transforms/LICM/2003-12-13-VolatilePromote.ll (original)
+++ llvm/trunk/test/Transforms/LICM/2003-12-13-VolatilePromote.ll (removed)
@@ -1,16 +0,0 @@
-; RUN: llvm-as < %s | opt -licm | llvm-dis | %prcontext volatile 1 | grep Loop
-
- at X = global i32 7 ; <i32*> [#uses=2]
-
-define void @testfunc(i32 %i) {
- br label %Loop
-Loop: ; preds = %Loop, %0
- ; Should not promote this to a register
- %x = volatile load i32* @X ; <i32> [#uses=1]
- %x2 = add i32 %x, 1 ; <i32> [#uses=1]
- store i32 %x2, i32* @X
- br i1 true, label %Out, label %Loop
-Out: ; preds = %Loop
- ret void
-}
-
Modified: llvm/trunk/test/Transforms/LICM/scalar_promote.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Transforms/LICM/scalar_promote.ll?rev=80521&r1=80520&r2=80521&view=diff
==============================================================================
--- llvm/trunk/test/Transforms/LICM/scalar_promote.ll (original)
+++ llvm/trunk/test/Transforms/LICM/scalar_promote.ll Sun Aug 30 17:08:19 2009
@@ -1,13 +1,17 @@
-; RUN: llvm-as < %s | opt -licm -disable-output -stats |& \
-; RUN: grep {memory locations promoted to register}
+; RUN: llvm-as < %s | opt -licm | llvm-dis | FileCheck %s
@X = global i32 7 ; <i32*> [#uses=4]
-define void @testfunc(i32 %i) {
-; <label>:0
+define void @test1(i32 %i) {
+Entry:
br label %Loop
+; CHECK: @test1
+; CHECK: Entry:
+; CHECK-NEXT: load i32* @X
+; CHECK-NEXT: br label %Loop
+
Loop: ; preds = %Loop, %0
- %j = phi i32 [ 0, %0 ], [ %Next, %Loop ] ; <i32> [#uses=1]
+ %j = phi i32 [ 0, %Entry ], [ %Next, %Loop ] ; <i32> [#uses=1]
%x = load i32* @X ; <i32> [#uses=1]
%x2 = add i32 %x, 1 ; <i32> [#uses=1]
store i32 %x2, i32* @X
@@ -15,12 +19,23 @@
%cond = icmp eq i32 %Next, 0 ; <i1> [#uses=1]
br i1 %cond, label %Out, label %Loop
-Out: ; preds = %Loop
+Out:
ret void
+; CHECK: Out:
+; CHECK-NEXT: store i32 %x2, i32* @X
+; CHECK-NEXT: ret void
+
}
-define void @testhard(i32 %i) {
+define void @test2(i32 %i) {
+Entry:
br label %Loop
+; CHECK: @test2
+; CHECK: Entry:
+; CHECK-NEXT: %X1 = getelementptr i32* @X, i64 0
+; CHECK-NEXT: %X2 = getelementptr i32* @X, i64 0
+; CHECK-NEXT: %X1.promoted = load i32* %X1
+; CHECK-NEXT: br label %Loop
Loop: ; preds = %Loop, %0
%X1 = getelementptr i32* @X, i64 0 ; <i32*> [#uses=1]
@@ -32,4 +47,27 @@
Exit: ; preds = %Loop
ret void
+; CHECK: Exit:
+; CHECK-NEXT: store i32 %V, i32* %X1
+; CHECK-NEXT: ret void
}
+
+
+
+define void @test3(i32 %i) {
+; CHECK: @test3
+ br label %Loop
+Loop:
+ ; Should not promote this to a register
+ %x = volatile load i32* @X
+ %x2 = add i32 %x, 1
+ store i32 %x2, i32* @X
+ br i1 true, label %Out, label %Loop
+
+; CHECK: Loop:
+; CHECK-NEXT: volatile load
+
+Out: ; preds = %Loop
+ ret void
+}
+
More information about the llvm-commits
mailing list