[llvm-commits] CVS: llvm/test/Regression/Transforms/InstCombine/2003-06-22-ConstantExprCrash.ll load.ll cast.ll getelementptr.ll mul.ll
John Criswell
criswell at choi.cs.uiuc.edu
Thu Jun 26 16:41:04 PDT 2003
Changes in directory llvm/test/Regression/Transforms/InstCombine:
2003-06-22-ConstantExprCrash.ll added (r1.1.2.1)
load.ll added (r1.1.2.1)
cast.ll updated: 1.6 -> 1.6.2.1
getelementptr.ll updated: 1.8 -> 1.8.2.1
mul.ll updated: 1.5 -> 1.5.2.1
---
Log message:
Merged with mainline on Thursday, June 26, 2003.
---
Diffs of the changes:
Index: llvm/test/Regression/Transforms/InstCombine/2003-06-22-ConstantExprCrash.ll
diff -c /dev/null llvm/test/Regression/Transforms/InstCombine/2003-06-22-ConstantExprCrash.ll:1.1
*** /dev/null Thu Jun 26 16:37:31 2003
--- llvm/test/Regression/Transforms/InstCombine/2003-06-22-ConstantExprCrash.ll Sun Jun 22 15:45:39 2003
***************
*** 0 ****
--- 1,12 ----
+ ; This is a bug in the VMcode library, not instcombine, it's just convenient
+ ; to expose it here.
+
+ ; RUN: as < %s | opt -instcombine -disable-output
+
+ %A = global int 1
+ %B = global int 2
+
+ bool %test() {
+ %C = setlt int* getelementptr (int* %A, long 1), getelementptr (int* %B, long 2) ; Will get promoted to constantexpr
+ ret bool %C
+ }
Index: llvm/test/Regression/Transforms/InstCombine/load.ll
diff -c /dev/null llvm/test/Regression/Transforms/InstCombine/load.ll:1.1
*** /dev/null Thu Jun 26 16:37:31 2003
--- llvm/test/Regression/Transforms/InstCombine/load.ll Thu Jun 26 00:05:51 2003
***************
*** 0 ****
--- 1,29 ----
+ ; This test makes sure that these instructions are properly eliminated.
+ ;
+
+ ; RUN: if as < %s | opt -instcombine | dis | grep load
+ ; RUN: then exit 1
+ ; RUN: else exit 0
+ ; RUN: fi
+
+ %X = constant int 42
+ %Y = constant [2 x { int, float }] [ { int, float } { int 12, float 1.0 },
+ { int, float } { int 37, float 1.2312 } ]
+ int %test1() {
+ %B = load int* %X
+ ret int %B
+ }
+
+ float %test2() {
+ %A = getelementptr [2 x { int, float}]* %Y, long 0, long 1, ubyte 1
+ %B = load float* %A
+ ret float %B
+ }
+
+ int %test3() {
+ %A = getelementptr [2 x { int, float}]* %Y, long 0, long 0, ubyte 0
+ %B = load int* %A
+ ret int %B
+ }
+
+
Index: llvm/test/Regression/Transforms/InstCombine/cast.ll
diff -u llvm/test/Regression/Transforms/InstCombine/cast.ll:1.6 llvm/test/Regression/Transforms/InstCombine/cast.ll:1.6.2.1
--- llvm/test/Regression/Transforms/InstCombine/cast.ll:1.6 Mon Sep 23 18:39:17 2002
+++ llvm/test/Regression/Transforms/InstCombine/cast.ll Thu Jun 26 16:35:51 2003
@@ -68,3 +68,22 @@
%c2 = cast uint %c1 to short
ret short %c2
}
+
+bool %test11(ubyte %A, ubyte %B) {
+ %C = sub ubyte %A, %B
+ %D = cast ubyte %C to bool ; == setne A, B
+ ret bool %D
+}
+
+bool %test12(ubyte %A) {
+ %B = add ubyte %A, 255
+ %C = cast ubyte %B to bool ; === A != 1
+ ret bool %C
+}
+
+bool %test13(ubyte %A, ubyte %b) {
+ %B = add ubyte %A, %b
+ %C = cast ubyte %B to bool ; === A != -b
+ ret bool %C
+}
+
Index: llvm/test/Regression/Transforms/InstCombine/getelementptr.ll
diff -u llvm/test/Regression/Transforms/InstCombine/getelementptr.ll:1.8 llvm/test/Regression/Transforms/InstCombine/getelementptr.ll:1.8.2.1
--- llvm/test/Regression/Transforms/InstCombine/getelementptr.ll:1.8 Wed Mar 5 16:32:48 2003
+++ llvm/test/Regression/Transforms/InstCombine/getelementptr.ll Thu Jun 26 16:35:51 2003
@@ -48,3 +48,9 @@
%B = getelementptr int* %A, long %D
ret int* %B
}
+
+sbyte* %foo8([10 x int]* %X) {
+ %A = getelementptr [10 x int]* %X, long 0, long 0 ;; Fold into the cast.
+ %B = cast int* %A to sbyte*
+ ret sbyte * %B
+}
Index: llvm/test/Regression/Transforms/InstCombine/mul.ll
diff -u llvm/test/Regression/Transforms/InstCombine/mul.ll:1.5 llvm/test/Regression/Transforms/InstCombine/mul.ll:1.5.2.1
--- llvm/test/Regression/Transforms/InstCombine/mul.ll:1.5 Mon Mar 10 16:43:56 2003
+++ llvm/test/Regression/Transforms/InstCombine/mul.ll Thu Jun 26 16:35:51 2003
@@ -33,8 +33,18 @@
ret int %B
}
-int %test6(ubyte %A) {
+ubyte %test6(ubyte %A) {
%B = mul ubyte %A, 8
%C = mul ubyte %B, 13
ret ubyte %C
+}
+
+int %test7(int %i) {
+ %tmp = mul int %i, -1 ; %tmp = sub 0, %i
+ ret int %tmp
+}
+
+ulong %test8(ulong %i) {
+ %j = mul ulong %i, 18446744073709551615 ; tmp = sub 0, %i
+ ret ulong %j
}
More information about the llvm-commits
mailing list