[llvm-commits] CVS: llvm/test/Regression/Transforms/InstCombine/2006-12-08-Phi-ICmp-Op-Fold.ll 2006-12-08-Select-ICmp.ll JavaCompare.ll
Reid Spencer
reid at x10sys.com
Fri Dec 8 21:13:16 PST 2006
Changes in directory llvm/test/Regression/Transforms/InstCombine:
2006-12-08-Phi-ICmp-Op-Fold.ll added (r1.1)
2006-12-08-Select-ICmp.ll added (r1.1)
JavaCompare.ll updated: 1.2 -> 1.3
---
Log message:
New test cases for regressions in the SetCC -> ICmp patch.
---
Diffs of the changes: (+97 -1)
2006-12-08-Phi-ICmp-Op-Fold.ll | 54 +++++++++++++++++++++++++++++++++++++++++
2006-12-08-Select-ICmp.ll | 42 +++++++++++++++++++++++++++++++
JavaCompare.ll | 2 -
3 files changed, 97 insertions(+), 1 deletion(-)
Index: llvm/test/Regression/Transforms/InstCombine/2006-12-08-Phi-ICmp-Op-Fold.ll
diff -c /dev/null llvm/test/Regression/Transforms/InstCombine/2006-12-08-Phi-ICmp-Op-Fold.ll:1.1
*** /dev/null Fri Dec 8 23:13:11 2006
--- llvm/test/Regression/Transforms/InstCombine/2006-12-08-Phi-ICmp-Op-Fold.ll Fri Dec 8 23:13:01 2006
***************
*** 0 ****
--- 1,54 ----
+ ; RUN: llvm-upgrade < %s | llvm-as | opt -instcombine | llvm-dis | grep 'setlt'
+ ; ModuleID = 'visible.bc'
+ target datalayout = "e-p:32:32"
+ target endian = little
+ target pointersize = 32
+ target triple = "i686-pc-linux-gnu"
+ %struct.point = type { int, int }
+
+ implementation ; Functions:
+
+ int %visible(int %direction, long %p1.0, long %p2.0, long %p3.0) {
+ entry:
+ %p1_addr = alloca %struct.point ; <%struct.point*> [#uses=2]
+ %p2_addr = alloca %struct.point ; <%struct.point*> [#uses=2]
+ %p3_addr = alloca %struct.point ; <%struct.point*> [#uses=2]
+ "alloca point" = bitcast int 0 to int ; <int> [#uses=0]
+ %tmp = bitcast %struct.point* %p1_addr to { long }* ; <{ long }*> [#uses=1]
+ %tmp = getelementptr { long }* %tmp, uint 0, uint 0 ; <long*> [#uses=1]
+ store long %p1.0, long* %tmp
+ %tmp1 = bitcast %struct.point* %p2_addr to { long }* ; <{ long }*> [#uses=1]
+ %tmp2 = getelementptr { long }* %tmp1, uint 0, uint 0 ; <long*> [#uses=1]
+ store long %p2.0, long* %tmp2
+ %tmp3 = bitcast %struct.point* %p3_addr to { long }* ; <{ long }*> [#uses=1]
+ %tmp4 = getelementptr { long }* %tmp3, uint 0, uint 0 ; <long*> [#uses=1]
+ store long %p3.0, long* %tmp4
+ %tmp = seteq int %direction, 0 ; <bool> [#uses=1]
+ %tmp5 = bitcast %struct.point* %p1_addr to { long }* ; <{ long }*> [#uses=1]
+ %tmp6 = getelementptr { long }* %tmp5, uint 0, uint 0 ; <long*> [#uses=1]
+ %tmp = load long* %tmp6 ; <long> [#uses=1]
+ %tmp7 = bitcast %struct.point* %p2_addr to { long }* ; <{ long }*> [#uses=1]
+ %tmp8 = getelementptr { long }* %tmp7, uint 0, uint 0 ; <long*> [#uses=1]
+ %tmp9 = load long* %tmp8 ; <long> [#uses=1]
+ %tmp10 = bitcast %struct.point* %p3_addr to { long }* ; <{ long }*> [#uses=1]
+ %tmp11 = getelementptr { long }* %tmp10, uint 0, uint 0 ; <long*> [#uses=1]
+ %tmp12 = load long* %tmp11 ; <long> [#uses=1]
+ %tmp13 = call int %determinant( long %tmp, long %tmp9, long %tmp12 ) ; <int> [#uses=2]
+ br bool %tmp, label %cond_true, label %cond_false
+
+ cond_true: ; preds = %entry
+ %tmp14 = setlt int %tmp13, 0 ; <bool> [#uses=1]
+ %tmp14 = zext bool %tmp14 to int ; <int> [#uses=1]
+ br label %return
+
+ cond_false: ; preds = %entry
+ %tmp26 = setgt int %tmp13, 0 ; <bool> [#uses=1]
+ %tmp26 = zext bool %tmp26 to int ; <int> [#uses=1]
+ br label %return
+
+ return: ; preds = %cond_false, %cond_true
+ %retval.0 = phi int [ %tmp14, %cond_true ], [ %tmp26, %cond_false ] ; <int> [#uses=1]
+ ret int %retval.0
+ }
+
+ declare int %determinant(long, long, long)
Index: llvm/test/Regression/Transforms/InstCombine/2006-12-08-Select-ICmp.ll
diff -c /dev/null llvm/test/Regression/Transforms/InstCombine/2006-12-08-Select-ICmp.ll:1.1
*** /dev/null Fri Dec 8 23:13:16 2006
--- llvm/test/Regression/Transforms/InstCombine/2006-12-08-Select-ICmp.ll Fri Dec 8 23:13:01 2006
***************
*** 0 ****
--- 1,42 ----
+ ; RUN: llvm-upgrade < %s | llvm-as | opt -instcombine | llvm-dis | grep select
+ target datalayout = "e-p:32:32"
+ target endian = little
+ target pointersize = 32
+ target triple = "i686-pc-linux-gnu"
+ %struct.point = type { int, int }
+
+ implementation ; Functions:
+
+ int %visible(int %direction, long %p1.0, long %p2.0, long %p3.0) {
+ entry:
+ %p1_addr = alloca %struct.point ; <%struct.point*> [#uses=2]
+ %p2_addr = alloca %struct.point ; <%struct.point*> [#uses=2]
+ %p3_addr = alloca %struct.point ; <%struct.point*> [#uses=2]
+ %tmp = bitcast %struct.point* %p1_addr to { long }* ; <{ long }*> [#uses=1]
+ %tmp = getelementptr { long }* %tmp, int 0, uint 0 ; <long*> [#uses=1]
+ store long %p1.0, long* %tmp
+ %tmp1 = bitcast %struct.point* %p2_addr to { long }* ; <{ long }*> [#uses=1]
+ %tmp2 = getelementptr { long }* %tmp1, int 0, uint 0 ; <long*> [#uses=1]
+ store long %p2.0, long* %tmp2
+ %tmp3 = bitcast %struct.point* %p3_addr to { long }* ; <{ long }*> [#uses=1]
+ %tmp4 = getelementptr { long }* %tmp3, int 0, uint 0 ; <long*> [#uses=1]
+ store long %p3.0, long* %tmp4
+ %tmp = seteq int %direction, 0 ; <bool> [#uses=1]
+ %tmp5 = bitcast %struct.point* %p1_addr to { long }* ; <{ long }*> [#uses=1]
+ %tmp6 = getelementptr { long }* %tmp5, int 0, uint 0 ; <long*> [#uses=1]
+ %tmp = load long* %tmp6 ; <long> [#uses=1]
+ %tmp7 = bitcast %struct.point* %p2_addr to { long }* ; <{ long }*> [#uses=1]
+ %tmp8 = getelementptr { long }* %tmp7, int 0, uint 0 ; <long*> [#uses=1]
+ %tmp9 = load long* %tmp8 ; <long> [#uses=1]
+ %tmp10 = bitcast %struct.point* %p3_addr to { long }* ; <{ long }*> [#uses=1]
+ %tmp11 = getelementptr { long }* %tmp10, int 0, uint 0 ; <long*> [#uses=1]
+ %tmp12 = load long* %tmp11 ; <long> [#uses=1]
+ %tmp13 = call int %determinant( long %tmp, long %tmp9, long %tmp12 ) ; <int> [#uses=2]
+ %tmp14 = setlt int %tmp13, 0 ; <bool> [#uses=1]
+ %tmp26 = setgt int %tmp13, 0 ; <bool> [#uses=1]
+ %retval.0.in = select bool %tmp, bool %tmp14, bool %tmp26 ; <bool> [#uses=1]
+ %retval.0 = zext bool %retval.0.in to int ; <int> [#uses=1]
+ ret int %retval.0
+ }
+
+ declare int %determinant(long, long, long)
Index: llvm/test/Regression/Transforms/InstCombine/JavaCompare.ll
diff -u llvm/test/Regression/Transforms/InstCombine/JavaCompare.ll:1.2 llvm/test/Regression/Transforms/InstCombine/JavaCompare.ll:1.3
--- llvm/test/Regression/Transforms/InstCombine/JavaCompare.ll:1.2 Fri Dec 1 22:23:09 2006
+++ llvm/test/Regression/Transforms/InstCombine/JavaCompare.ll Fri Dec 8 23:13:01 2006
@@ -1,7 +1,7 @@
; This is the sequence of stuff that the Java front-end expands for a single
; <= comparison. Check to make sure we turn it into a <= (only)
-; RUN: llvm-upgrade < %s | llvm-as | opt -instcombine | llvm-dis | grep -v setle | not grep '#uses'
+; RUN: llvm-upgrade < %s | llvm-as | opt -instcombine | llvm-dis | grep -v 'icmp sle'| not grep '#uses'
bool %le(int %A, int %B) {
%c1 = setgt int %A, %B;
More information about the llvm-commits
mailing list