Use InstrSlots::NUM rather than pre-dividing by four. Also, mark this const.
[oota-llvm.git] / test / Analysis / LoadVN / call_cse.ll
index 78cdd43051feff3c032d2af84fca993d065611da..b62300f5ab331c3e2379c817f65c01a448cc63c6 100644 (file)
@@ -1,11 +1,12 @@
-; RUN: llvm-upgrade < %s | llvm-as | opt -basicaa -load-vn -gcse -instcombine | llvm-dis | not grep sub
-declare int %strlen(sbyte*)
+; RUN: llvm-as < %s | opt -basicaa -load-vn -gcse -instcombine | llvm-dis | not grep sub
 
-int %test(sbyte* %P) {
-       %X = call int %strlen(sbyte* %P)
-       %A = add int %X, 14
-       %Y = call int %strlen(sbyte* %P)
-       %Z = sub int %X, %Y
-       %B = add int %A, %Z
-       ret int %B
+declare i32 @strlen(i8*) readonly
+
+define i32 @test(i8* %P) {
+       %X = call i32 @strlen( i8* %P ) readonly                ; <i32> [#uses=2]
+       %A = add i32 %X, 14             ; <i32> [#uses=1]
+       %Y = call i32 @strlen( i8* %P ) readonly                ; <i32> [#uses=1]
+       %Z = sub i32 %X, %Y             ; <i32> [#uses=1]
+       %B = add i32 %A, %Z             ; <i32> [#uses=1]
+       ret i32 %B
 }