diff options
author | Reid Spencer <rspencer@reidspencer.com> | 2006-12-23 06:05:41 +0000 |
---|---|---|
committer | Reid Spencer <rspencer@reidspencer.com> | 2006-12-23 06:05:41 +0000 |
commit | e4d87aa2de6e52952dca73716386db09aad5a8fd (patch) | |
tree | ce8c6e6ddc845de3585020c856118892f4206593 /test | |
parent | add2bd7f5941537a97a41e037ae2277fbeed0b4f (diff) | |
download | external_llvm-e4d87aa2de6e52952dca73716386db09aad5a8fd.zip external_llvm-e4d87aa2de6e52952dca73716386db09aad5a8fd.tar.gz external_llvm-e4d87aa2de6e52952dca73716386db09aad5a8fd.tar.bz2 |
For PR950:
This patch removes the SetCC instructions and replaces them with the ICmp
and FCmp instructions. The SetCondInst instruction has been removed and
been replaced with ICmpInst and FCmpInst.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@32751 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test')
-rw-r--r-- | test/CFrontend/2006-12-14-ordered_expr.c | 3 | ||||
-rw-r--r-- | test/Transforms/IndVarsSimplify/tripcount_infinite.llx | 4 | ||||
-rw-r--r-- | test/Transforms/InstCombine/2006-12-08-Phi-ICmp-Op-Fold.ll | 2 | ||||
-rw-r--r-- | test/Transforms/InstCombine/2006-12-10-ICmp-GEP-GEP.ll | 165 | ||||
-rw-r--r-- | test/Transforms/InstCombine/2006-12-15-Range-Test.ll | 32 | ||||
-rw-r--r-- | test/Transforms/InstCombine/JavaCompare.ll | 2 | ||||
-rw-r--r-- | test/Transforms/InstCombine/cast.ll | 11 | ||||
-rw-r--r-- | test/Transforms/InstCombine/set.ll | 2 | ||||
-rw-r--r-- | test/Transforms/InstCombine/setcc-strength-reduce.ll | 2 | ||||
-rw-r--r-- | test/Transforms/LoopSimplify/2006-08-11-LoopSimplifyLongTime.ll.bc | bin | 165219 -> 165491 bytes | |||
-rw-r--r-- | test/Transforms/LoopStrengthReduce/exit_compare_live_range.ll | 2 | ||||
-rw-r--r-- | test/Transforms/SimplifyCFG/2006-12-08-Ptr-ICmp-Branch.ll | 144 | ||||
-rw-r--r-- | test/Transforms/SimplifyCFG/DeadSetCC.ll | 2 |
13 files changed, 356 insertions, 15 deletions
diff --git a/test/CFrontend/2006-12-14-ordered_expr.c b/test/CFrontend/2006-12-14-ordered_expr.c index 4e7dafe..090b989 100644 --- a/test/CFrontend/2006-12-14-ordered_expr.c +++ b/test/CFrontend/2006-12-14-ordered_expr.c @@ -1,5 +1,4 @@ -// RUN: %llvmgcc -O3 -S %s -o - | grep llvm.isunordered && -// RUN: %llvmgcc -O3 -S %s -o - | grep xor +// RUN: %llvmgcc -O3 -S %s -o - | grep 'fcmp ord float %X, %Y' int test2(float X, float Y) { return !__builtin_isunordered(X, Y); diff --git a/test/Transforms/IndVarsSimplify/tripcount_infinite.llx b/test/Transforms/IndVarsSimplify/tripcount_infinite.llx index d20e855..8a7b27c 100644 --- a/test/Transforms/IndVarsSimplify/tripcount_infinite.llx +++ b/test/Transforms/IndVarsSimplify/tripcount_infinite.llx @@ -1,8 +1,8 @@ ; These tests have an infinite trip count. We obviously shouldn't remove the ; loops! :) ; -; RUN: llvm-upgrade < %s | llvm-as | opt -indvars -adce -simplifycfg | llvm-dis | grep set | wc -l > %t2 -; RUN: llvm-upgrade < %s | llvm-as | llvm-dis | grep set | wc -l > %t1 +; RUN: llvm-upgrade < %s | llvm-as | opt -indvars -adce -simplifycfg | llvm-dis | grep icmp | wc -l > %t2 +; RUN: llvm-upgrade < %s | llvm-as | llvm-dis | grep icmp | wc -l > %t1 ; RUN: diff %t1 %t2 int %infinite_linear() { ;; test for (i = 1; i != 100; i += 2) diff --git a/test/Transforms/InstCombine/2006-12-08-Phi-ICmp-Op-Fold.ll b/test/Transforms/InstCombine/2006-12-08-Phi-ICmp-Op-Fold.ll index 4881b55..3c2c25c 100644 --- a/test/Transforms/InstCombine/2006-12-08-Phi-ICmp-Op-Fold.ll +++ b/test/Transforms/InstCombine/2006-12-08-Phi-ICmp-Op-Fold.ll @@ -1,4 +1,4 @@ -; RUN: llvm-upgrade < %s | llvm-as | opt -instcombine | llvm-dis | grep 'setlt' +; RUN: llvm-upgrade < %s | llvm-as | opt -instcombine | llvm-dis|grep 'icmp slt' ; ModuleID = 'visible.bc' target datalayout = "e-p:32:32" target endian = little diff --git a/test/Transforms/InstCombine/2006-12-10-ICmp-GEP-GEP.ll b/test/Transforms/InstCombine/2006-12-10-ICmp-GEP-GEP.ll new file mode 100644 index 0000000..e5ac37b --- /dev/null +++ b/test/Transforms/InstCombine/2006-12-10-ICmp-GEP-GEP.ll @@ -0,0 +1,165 @@ +; RUN: llvm-upgrade < %s | llvm-as | opt -instcombine | llvm-dis | \ +; RUN: grep -v 'icmp ult int' +; ModuleID = 'good.bc' +target datalayout = "e-p:32:32" +target endian = little +target pointersize = 32 +target triple = "i686-pc-linux-gnu" + %struct.edgeBox = type { short, short, short, short, short, short } +%qsz = external global int ; <int*> [#uses=12] +%thresh = external global int ; <int*> [#uses=2] +%mthresh = external global int ; <int*> [#uses=1] + +implementation ; Functions: + +int %qsorte(sbyte* %base, int %n, int %size) { +entry: + %tmp = setgt int %n, 1 ; <bool> [#uses=1] + br bool %tmp, label %cond_next, label %return + +cond_next: ; preds = %entry + store int %size, int* %qsz + %tmp3 = shl int %size, ubyte 2 ; <int> [#uses=1] + store int %tmp3, int* %thresh + %tmp4 = load int* %qsz ; <int> [#uses=1] + %tmp5 = mul int %tmp4, 6 ; <int> [#uses=1] + store int %tmp5, int* %mthresh + %tmp6 = load int* %qsz ; <int> [#uses=1] + %tmp8 = mul int %tmp6, %n ; <int> [#uses=1] + %tmp9 = getelementptr sbyte* %base, int %tmp8 ; <sbyte*> [#uses=3] + %tmp11 = setgt int %n, 3 ; <bool> [#uses=1] + br bool %tmp11, label %cond_true12, label %bb30 + +cond_true12: ; preds = %cond_next + %tmp156 = call int %qste( sbyte* %base, sbyte* %tmp9 ) ; <int> [#uses=0] + %tmp16 = load int* %thresh ; <int> [#uses=1] + %tmp18 = getelementptr sbyte* %base, int %tmp16 ; <sbyte*> [#uses=2] + %tmp3117 = load int* %qsz ; <int> [#uses=1] + %tmp3318 = getelementptr sbyte* %base, int %tmp3117 ; <sbyte*> [#uses=2] + %tmp3621 = setlt sbyte* %tmp3318, %tmp18 ; <bool> [#uses=1] + br bool %tmp3621, label %bb, label %bb37 + +bb: ; preds = %bb30, %cond_true12 + %hi.0.0 = phi sbyte* [ %tmp18, %cond_true12 ], [ %hi.0, %bb30 ] ; <sbyte*> [#uses=4] + %j.1.0 = phi sbyte* [ %base, %cond_true12 ], [ %j.1, %bb30 ] ; <sbyte*> [#uses=4] + %tmp33.0 = phi sbyte* [ %tmp3318, %cond_true12 ], [ %tmp33, %bb30 ] ; <sbyte*> [#uses=6] + %tmp3 = bitcast sbyte* %j.1.0 to %struct.edgeBox* ; <%struct.edgeBox*> [#uses=1] + %tmp4 = bitcast sbyte* %tmp33.0 to %struct.edgeBox* ; <%struct.edgeBox*> [#uses=1] + %tmp255 = call int %comparee( %struct.edgeBox* %tmp3, %struct.edgeBox* %tmp4 ) ; <int> [#uses=1] + %tmp26 = setgt int %tmp255, 0 ; <bool> [#uses=1] + br bool %tmp26, label %cond_true27, label %bb30 + +cond_true27: ; preds = %bb + br label %bb30 + +bb30: ; preds = %cond_true27, %bb, %cond_next + %hi.0.3 = phi sbyte* [ %hi.0.0, %cond_true27 ], [ %hi.0.0, %bb ], [ undef, %cond_next ] ; <sbyte*> [#uses=0] + %j.1.3 = phi sbyte* [ %j.1.0, %cond_true27 ], [ %j.1.0, %bb ], [ undef, %cond_next ] ; <sbyte*> [#uses=0] + %tmp33.3 = phi sbyte* [ %tmp33.0, %cond_true27 ], [ %tmp33.0, %bb ], [ undef, %cond_next ] ; <sbyte*> [#uses=0] + %hi.0 = phi sbyte* [ %tmp9, %cond_next ], [ %hi.0.0, %bb ], [ %hi.0.0, %cond_true27 ] ; <sbyte*> [#uses=2] + %lo.1 = phi sbyte* [ %tmp33.0, %cond_true27 ], [ %tmp33.0, %bb ], [ %base, %cond_next ] ; <sbyte*> [#uses=1] + %j.1 = phi sbyte* [ %tmp33.0, %cond_true27 ], [ %j.1.0, %bb ], [ %base, %cond_next ] ; <sbyte*> [#uses=2] + %tmp31 = load int* %qsz ; <int> [#uses=1] + %tmp33 = getelementptr sbyte* %lo.1, int %tmp31 ; <sbyte*> [#uses=2] + %tmp36 = setlt sbyte* %tmp33, %hi.0 ; <bool> [#uses=1] + br bool %tmp36, label %bb, label %bb37 + +bb37: ; preds = %bb30, %cond_true12 + %j.1.1 = phi sbyte* [ %j.1, %bb30 ], [ %base, %cond_true12 ] ; <sbyte*> [#uses=4] + %tmp40 = seteq sbyte* %j.1.1, %base ; <bool> [#uses=1] + br bool %tmp40, label %bb115, label %cond_true41 + +cond_true41: ; preds = %bb37 + %tmp43 = load int* %qsz ; <int> [#uses=1] + %tmp45 = getelementptr sbyte* %base, int %tmp43 ; <sbyte*> [#uses=2] + %tmp6030 = setlt sbyte* %base, %tmp45 ; <bool> [#uses=1] + br bool %tmp6030, label %bb46, label %bb115 + +bb46: ; preds = %bb46, %cond_true41 + %j.2.0 = phi sbyte* [ %j.1.1, %cond_true41 ], [ %tmp52, %bb46 ] ; <sbyte*> [#uses=3] + %i.2.0 = phi sbyte* [ %base, %cond_true41 ], [ %tmp56, %bb46 ] ; <sbyte*> [#uses=3] + %tmp = load sbyte* %j.2.0 ; <sbyte> [#uses=2] + %tmp49 = load sbyte* %i.2.0 ; <sbyte> [#uses=1] + store sbyte %tmp49, sbyte* %j.2.0 + %tmp52 = getelementptr sbyte* %j.2.0, int 1 ; <sbyte*> [#uses=2] + store sbyte %tmp, sbyte* %i.2.0 + %tmp56 = getelementptr sbyte* %i.2.0, int 1 ; <sbyte*> [#uses=3] + %tmp60 = setlt sbyte* %tmp56, %tmp45 ; <bool> [#uses=1] + br bool %tmp60, label %bb46, label %bb115 + +bb66: ; preds = %bb115, %bb66 + %hi.3 = phi sbyte* [ %tmp118, %bb115 ], [ %tmp70, %bb66 ] ; <sbyte*> [#uses=2] + %tmp67 = load int* %qsz ; <int> [#uses=2] + %tmp68 = sub int 0, %tmp67 ; <int> [#uses=1] + %tmp70 = getelementptr sbyte* %hi.3, int %tmp68 ; <sbyte*> [#uses=2] + %tmp = bitcast sbyte* %tmp70 to %struct.edgeBox* ; <%struct.edgeBox*> [#uses=1] + %tmp1 = bitcast sbyte* %tmp118 to %struct.edgeBox* ; <%struct.edgeBox*> [#uses=1] + %tmp732 = call int %comparee( %struct.edgeBox* %tmp, %struct.edgeBox* %tmp1 ) ; <int> [#uses=1] + %tmp74 = setgt int %tmp732, 0 ; <bool> [#uses=1] + br bool %tmp74, label %bb66, label %bb75 + +bb75: ; preds = %bb66 + %tmp76 = load int* %qsz ; <int> [#uses=1] + %tmp70.sum = sub int %tmp76, %tmp67 ; <int> [#uses=1] + %tmp78 = getelementptr sbyte* %hi.3, int %tmp70.sum ; <sbyte*> [#uses=3] + %tmp81 = seteq sbyte* %tmp78, %tmp118 ; <bool> [#uses=1] + br bool %tmp81, label %bb115, label %cond_true82 + +cond_true82: ; preds = %bb75 + %tmp83 = load int* %qsz ; <int> [#uses=1] + %tmp118.sum = add int %tmp116, %tmp83 ; <int> [#uses=1] + %tmp85 = getelementptr sbyte* %min.1, int %tmp118.sum ; <sbyte*> [#uses=1] + %tmp10937 = getelementptr sbyte* %tmp85, int -1 ; <sbyte*> [#uses=3] + %tmp11239 = setlt sbyte* %tmp10937, %tmp118 ; <bool> [#uses=1] + br bool %tmp11239, label %bb115, label %bb86 + +bb86: ; preds = %bb104, %cond_true82 + %tmp109.0 = phi sbyte* [ %tmp10937, %cond_true82 ], [ %tmp109, %bb104 ] ; <sbyte*> [#uses=5] + %i.5.2 = phi sbyte* [ %i.5.3, %cond_true82 ], [ %i.5.1, %bb104 ] ; <sbyte*> [#uses=0] + %tmp100.2 = phi sbyte* [ %tmp100.3, %cond_true82 ], [ %tmp100.1, %bb104 ] ; <sbyte*> [#uses=0] + %tmp88 = load sbyte* %tmp109.0 ; <sbyte> [#uses=2] + %tmp9746 = load int* %qsz ; <int> [#uses=1] + %tmp9847 = sub int 0, %tmp9746 ; <int> [#uses=1] + %tmp10048 = getelementptr sbyte* %tmp109.0, int %tmp9847 ; <sbyte*> [#uses=3] + %tmp10350 = setlt sbyte* %tmp10048, %tmp78 ; <bool> [#uses=1] + br bool %tmp10350, label %bb104, label %bb91 + +bb91: ; preds = %bb91, %bb86 + %i.5.0 = phi sbyte* [ %tmp109.0, %bb86 ], [ %tmp100.0, %bb91 ] ; <sbyte*> [#uses=1] + %tmp100.0 = phi sbyte* [ %tmp10048, %bb86 ], [ %tmp100, %bb91 ] ; <sbyte*> [#uses=4] + %tmp93 = load sbyte* %tmp100.0 ; <sbyte> [#uses=1] + store sbyte %tmp93, sbyte* %i.5.0 + %tmp97 = load int* %qsz ; <int> [#uses=1] + %tmp98 = sub int 0, %tmp97 ; <int> [#uses=1] + %tmp100 = getelementptr sbyte* %tmp100.0, int %tmp98 ; <sbyte*> [#uses=3] + %tmp103 = setlt sbyte* %tmp100, %tmp78 ; <bool> [#uses=1] + br bool %tmp103, label %bb104, label %bb91 + +bb104: ; preds = %bb91, %bb86 + %i.5.1 = phi sbyte* [ %tmp109.0, %bb86 ], [ %tmp100.0, %bb91 ] ; <sbyte*> [#uses=4] + %tmp100.1 = phi sbyte* [ %tmp10048, %bb86 ], [ %tmp100, %bb91 ] ; <sbyte*> [#uses=3] + store sbyte %tmp88, sbyte* %i.5.1 + %tmp109 = getelementptr sbyte* %tmp109.0, int -1 ; <sbyte*> [#uses=3] + %tmp112 = setlt sbyte* %tmp109, %tmp118 ; <bool> [#uses=1] + br bool %tmp112, label %bb115, label %bb86 + +bb115: ; preds = %bb104, %cond_true82, %bb75, %bb46, %cond_true41, %bb37 + %tmp109.1 = phi sbyte* [ undef, %bb37 ], [ %tmp109.1, %bb75 ], [ %tmp10937, %cond_true82 ], [ %tmp109, %bb104 ], [ undef, %bb46 ], [ undef, %cond_true41 ] ; <sbyte*> [#uses=1] + %i.5.3 = phi sbyte* [ undef, %bb37 ], [ %i.5.3, %bb75 ], [ %i.5.3, %cond_true82 ], [ %i.5.1, %bb104 ], [ undef, %bb46 ], [ undef, %cond_true41 ] ; <sbyte*> [#uses=3] + %tmp100.3 = phi sbyte* [ undef, %bb37 ], [ %tmp100.3, %bb75 ], [ %tmp100.3, %cond_true82 ], [ %tmp100.1, %bb104 ], [ undef, %bb46 ], [ undef, %cond_true41 ] ; <sbyte*> [#uses=3] + %min.1 = phi sbyte* [ %tmp118, %bb104 ], [ %tmp118, %bb75 ], [ %base, %bb37 ], [ %base, %bb46 ], [ %base, %cond_true41 ], [ %tmp118, %cond_true82 ] ; <sbyte*> [#uses=2] + %j.5 = phi sbyte* [ %tmp100.1, %bb104 ], [ %j.5, %bb75 ], [ %tmp52, %bb46 ], [ %j.1.1, %bb37 ], [ %j.1.1, %cond_true41 ], [ %j.5, %cond_true82 ] ; <sbyte*> [#uses=2] + %i.4 = phi sbyte* [ %i.5.1, %bb104 ], [ %i.4, %bb75 ], [ %tmp56, %bb46 ], [ undef, %bb37 ], [ %base, %cond_true41 ], [ %i.4, %cond_true82 ] ; <sbyte*> [#uses=2] + %c.4 = phi sbyte [ %tmp88, %bb104 ], [ %c.4, %bb75 ], [ %tmp, %bb46 ], [ undef, %bb37 ], [ undef, %cond_true41 ], [ %c.4, %cond_true82 ] ; <sbyte> [#uses=2] + %tmp116 = load int* %qsz ; <int> [#uses=2] + %tmp118 = getelementptr sbyte* %min.1, int %tmp116 ; <sbyte*> [#uses=9] + %tmp122 = setlt sbyte* %tmp118, %tmp9 ; <bool> [#uses=1] + br bool %tmp122, label %bb66, label %return + +return: ; preds = %bb115, %entry + ret int undef +} + +declare int %qste(sbyte*, sbyte*) + +declare int %comparee(%struct.edgeBox*, %struct.edgeBox*) diff --git a/test/Transforms/InstCombine/2006-12-15-Range-Test.ll b/test/Transforms/InstCombine/2006-12-15-Range-Test.ll new file mode 100644 index 0000000..f7cf7e8 --- /dev/null +++ b/test/Transforms/InstCombine/2006-12-15-Range-Test.ll @@ -0,0 +1,32 @@ +; RUN: llvm-as < %s | opt -instcombine | llvm-dis | grep 'icmp' | wc -l | grep 1 +; RUN: llvm-as < %s | opt -instcombine | llvm-dis | grep 'icmp ugt' | wc -l | grep 1 +; ModuleID = 'bugpoint-tooptimize.bc' +target datalayout = "e-p:32:32" +target endian = little +target pointersize = 32 +target triple = "i686-pc-linux-gnu" +%r = external global [17 x int] ; <[17 x int]*> [#uses=1] + +implementation ; Functions: + +bool %print_pgm_cond_true(int %tmp12.reload, int* %tmp16.out) { +newFuncRoot: + br label %cond_true + +bb27.exitStub: ; preds = %cond_true + store int %tmp16, int* %tmp16.out + ret bool true + +cond_next23.exitStub: ; preds = %cond_true + store int %tmp16, int* %tmp16.out + ret bool false + +cond_true: ; preds = %newFuncRoot + %tmp15 = getelementptr [17 x int]* %r, int 0, int %tmp12.reload ; <int*> [#uses=1] + %tmp16 = load int* %tmp15 ; <int> [#uses=4] + %tmp18 = icmp slt int %tmp16, -31 ; <bool> [#uses=1] + %tmp21 = icmp sgt int %tmp16, 31 ; <bool> [#uses=1] + %bothcond = or bool %tmp18, %tmp21 ; <bool> [#uses=1] + br bool %bothcond, label %bb27.exitStub, label %cond_next23.exitStub +} + diff --git a/test/Transforms/InstCombine/JavaCompare.ll b/test/Transforms/InstCombine/JavaCompare.ll index f583fa9..11f706e 100644 --- a/test/Transforms/InstCombine/JavaCompare.ll +++ b/test/Transforms/InstCombine/JavaCompare.ll @@ -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; diff --git a/test/Transforms/InstCombine/cast.ll b/test/Transforms/InstCombine/cast.ll index 8c6e379..6cad43b 100644 --- a/test/Transforms/InstCombine/cast.ll +++ b/test/Transforms/InstCombine/cast.ll @@ -93,11 +93,12 @@ bool %test14(sbyte %A) { ret bool %X } -bool %test15(ubyte %A) { - %c = cast ubyte %A to sbyte - %X = setlt sbyte %c, 0 ; setgt %A, 127 - ret bool %X -} +; This just won't occur when there's no difference between ubyte and sbyte +;bool %test15(ubyte %A) { +; %c = cast ubyte %A to sbyte +; %X = setlt sbyte %c, 0 ; setgt %A, 127 +; ret bool %X +;} bool %test16(int* %P) { %c = cast int* %P to bool ;; setne P, null diff --git a/test/Transforms/InstCombine/set.ll b/test/Transforms/InstCombine/set.ll index a9ef2bf..ca1ccff 100644 --- a/test/Transforms/InstCombine/set.ll +++ b/test/Transforms/InstCombine/set.ll @@ -1,7 +1,7 @@ ; This test makes sure that these instructions are properly eliminated. ; ; RUN: llvm-upgrade < %s | llvm-as | opt -instcombine -disable-output && -; RUN: llvm-upgrade < %s | llvm-as | opt -instcombine | llvm-dis | not grep set +; RUN: llvm-upgrade < %s | llvm-as | opt -instcombine | llvm-dis | not grep icmp %X = uninitialized global int diff --git a/test/Transforms/InstCombine/setcc-strength-reduce.ll b/test/Transforms/InstCombine/setcc-strength-reduce.ll index 4c86206..d38c668 100644 --- a/test/Transforms/InstCombine/setcc-strength-reduce.ll +++ b/test/Transforms/InstCombine/setcc-strength-reduce.ll @@ -3,7 +3,7 @@ ; into equivalent setne,eq instructions. ; -; RUN: llvm-upgrade < %s | llvm-as | opt -instcombine | llvm-dis | grep -v seteq | grep -v setne | not grep set +; RUN: llvm-upgrade < %s | llvm-as | opt -instcombine | llvm-dis | grep -v 'icmp eq' | grep -v 'icmp ne' | not grep icmp bool %test1(uint %A) { %B = setge uint %A, 1 ; setne %A, 0 diff --git a/test/Transforms/LoopSimplify/2006-08-11-LoopSimplifyLongTime.ll.bc b/test/Transforms/LoopSimplify/2006-08-11-LoopSimplifyLongTime.ll.bc Binary files differindex bf87a11..75c92cf 100644 --- a/test/Transforms/LoopSimplify/2006-08-11-LoopSimplifyLongTime.ll.bc +++ b/test/Transforms/LoopSimplify/2006-08-11-LoopSimplifyLongTime.ll.bc diff --git a/test/Transforms/LoopStrengthReduce/exit_compare_live_range.ll b/test/Transforms/LoopStrengthReduce/exit_compare_live_range.ll index 3976f5d..5a34a2a 100644 --- a/test/Transforms/LoopStrengthReduce/exit_compare_live_range.ll +++ b/test/Transforms/LoopStrengthReduce/exit_compare_live_range.ll @@ -2,7 +2,7 @@ ; having overlapping live ranges that result in copies. We want the setcc instruction ; immediately before the conditional branch. ; -; RUN: llvm-upgrade < %s | llvm-as | opt -loop-reduce | llvm-dis | %prcontext 'br bool' 1 | grep set +; RUN: llvm-upgrade < %s | llvm-as | opt -loop-reduce | llvm-dis | %prcontext 'br bool' 1 | grep icmp void %foo(float* %D, uint %E) { entry: diff --git a/test/Transforms/SimplifyCFG/2006-12-08-Ptr-ICmp-Branch.ll b/test/Transforms/SimplifyCFG/2006-12-08-Ptr-ICmp-Branch.ll new file mode 100644 index 0000000..845530d --- /dev/null +++ b/test/Transforms/SimplifyCFG/2006-12-08-Ptr-ICmp-Branch.ll @@ -0,0 +1,144 @@ +; RUN: llvm-as < %s | opt -simplifycfg | llvm-dis +; ModuleID = 'bugpoint-tooptimize.bc' +target datalayout = "e-p:32:32" +target endian = little +target pointersize = 32 +target triple = "i686-pc-linux-gnu" + %struct.FILE = type { int, sbyte*, sbyte*, sbyte*, sbyte*, sbyte*, sbyte*, sbyte*, sbyte*, sbyte*, sbyte*, sbyte*, %struct._IO_marker*, %struct.FILE*, int, int, int, ushort, sbyte, [1 x sbyte], sbyte*, long, sbyte*, sbyte*, sbyte*, sbyte*, uint, int, [40 x sbyte] } + %struct._IO_FILE = type { int, sbyte*, sbyte*, sbyte*, sbyte*, sbyte*, sbyte*, sbyte*, sbyte*, sbyte*, sbyte*, sbyte*, %struct._IO_marker*, %struct.FILE*, int, int, int, ushort, sbyte, [1 x sbyte], sbyte*, long, sbyte*, sbyte*, sbyte*, sbyte*, uint, int, [40 x sbyte] } + %struct._IO_marker = type { %struct._IO_marker*, %struct.FILE*, int } + %struct.charsequence = type { sbyte*, uint, uint } + %struct.trie_s = type { [26 x %struct.trie_s*], int } +%str = external global [14 x sbyte] ; <[14 x sbyte]*> [#uses=0] +%str = external global [32 x sbyte] ; <[32 x sbyte]*> [#uses=0] +%str = external global [12 x sbyte] ; <[12 x sbyte]*> [#uses=0] +%C.0.2294 = external global %struct.charsequence ; <%struct.charsequence*> [#uses=3] +%t = external global %struct.trie_s* ; <%struct.trie_s**> [#uses=0] +%str = external global [3 x sbyte] ; <[3 x sbyte]*> [#uses=0] +%str = external global [26 x sbyte] ; <[26 x sbyte]*> [#uses=0] + +implementation ; Functions: + +declare void %charsequence_reset(%struct.charsequence*) +declare void %free(sbyte*) +declare void %charsequence_push(%struct.charsequence*, sbyte) +declare sbyte* %charsequence_val(%struct.charsequence*) +declare int %_IO_getc(%struct.FILE*) +declare int %tolower(int) +declare %struct.trie_s* %trie_insert(%struct.trie_s*, sbyte*) +declare int %feof(%struct.FILE*) + +void %addfile(%struct.trie_s* %t, %struct.FILE* %f) { +entry: + %t_addr = alloca %struct.trie_s* ; <%struct.trie_s**> [#uses=2] + %f_addr = alloca %struct.FILE* ; <%struct.FILE**> [#uses=3] + %c = alloca sbyte, align 1 ; <sbyte*> [#uses=7] + %wstate = alloca int, align 4 ; <int*> [#uses=4] + %cs = alloca %struct.charsequence, align 16 ; <%struct.charsequence*> [#uses=7] + %str = alloca sbyte*, align 4 ; <sbyte**> [#uses=3] + "alloca point" = bitcast int 0 to int ; <int> [#uses=0] + store %struct.trie_s* %t, %struct.trie_s** %t_addr + store %struct.FILE* %f, %struct.FILE** %f_addr + store int 0, int* %wstate + %tmp = getelementptr %struct.charsequence* %cs, uint 0, uint 0 ; <sbyte**> [#uses=1] + %tmp1 = getelementptr %struct.charsequence* %C.0.2294, uint 0, uint 0 ; <sbyte**> [#uses=1] + %tmp = load sbyte** %tmp1 ; <sbyte*> [#uses=1] + store sbyte* %tmp, sbyte** %tmp + %tmp = getelementptr %struct.charsequence* %cs, uint 0, uint 1 ; <uint*> [#uses=1] + %tmp2 = getelementptr %struct.charsequence* %C.0.2294, uint 0, uint 1 ; <uint*> [#uses=1] + %tmp = load uint* %tmp2 ; <uint> [#uses=1] + store uint %tmp, uint* %tmp + %tmp3 = getelementptr %struct.charsequence* %cs, uint 0, uint 2 ; <uint*> [#uses=1] + %tmp4 = getelementptr %struct.charsequence* %C.0.2294, uint 0, uint 2 ; <uint*> [#uses=1] + %tmp5 = load uint* %tmp4 ; <uint> [#uses=1] + store uint %tmp5, uint* %tmp3 + br label %bb33 + +bb: ; preds = %bb33 + %tmp = load %struct.FILE** %f_addr ; <%struct.FILE*> [#uses=1] + %tmp = call int %_IO_getc( %struct.FILE* %tmp ) ; <int> [#uses=1] + %tmp6 = call int %tolower( int %tmp ) ; <int> [#uses=1] + %tmp6 = trunc int %tmp6 to sbyte ; <sbyte> [#uses=1] + store sbyte %tmp6, sbyte* %c + %tmp7 = load int* %wstate ; <int> [#uses=1] + %tmp = icmp ne int %tmp7, 0 ; <bool> [#uses=1] + br bool %tmp, label %cond_true, label %cond_false + +cond_true: ; preds = %bb + %tmp = load sbyte* %c ; <sbyte> [#uses=1] + %tmp8 = icmp sle sbyte %tmp, 96 ; <bool> [#uses=1] + br bool %tmp8, label %cond_true9, label %cond_next + +cond_true9: ; preds = %cond_true + br label %bb16 + +cond_next: ; preds = %cond_true + %tmp10 = load sbyte* %c ; <sbyte> [#uses=1] + %tmp11 = icmp sgt sbyte %tmp10, 122 ; <bool> [#uses=1] + br bool %tmp11, label %cond_true12, label %cond_next13 + +cond_true12: ; preds = %cond_next + br label %bb16 + +cond_next13: ; preds = %cond_next + %tmp14 = load sbyte* %c ; <sbyte> [#uses=1] + %tmp14 = sext sbyte %tmp14 to int ; <int> [#uses=1] + %tmp1415 = trunc int %tmp14 to sbyte ; <sbyte> [#uses=1] + call void %charsequence_push( %struct.charsequence* %cs, sbyte %tmp1415 ) + br label %bb21 + +bb16: ; preds = %cond_true12, %cond_true9 + %tmp17 = call sbyte* %charsequence_val( %struct.charsequence* %cs ) ; <sbyte*> [#uses=1] + store sbyte* %tmp17, sbyte** %str + %tmp = load %struct.trie_s** %t_addr ; <%struct.trie_s*> [#uses=1] + %tmp18 = load sbyte** %str ; <sbyte*> [#uses=1] + %tmp19 = call %struct.trie_s* %trie_insert( %struct.trie_s* %tmp, sbyte* %tmp18 ) ; <%struct.trie_s*> [#uses=0] + %tmp20 = load sbyte** %str ; <sbyte*> [#uses=1] + call void %free( sbyte* %tmp20 ) + store int 0, int* %wstate + br label %bb21 + +bb21: ; preds = %bb16, %cond_next13 + br label %cond_next32 + +cond_false: ; preds = %bb + %tmp22 = load sbyte* %c ; <sbyte> [#uses=1] + %tmp23 = icmp sgt sbyte %tmp22, 96 ; <bool> [#uses=1] + br bool %tmp23, label %cond_true24, label %cond_next31 + +cond_true24: ; preds = %cond_false + %tmp25 = load sbyte* %c ; <sbyte> [#uses=1] + %tmp26 = icmp sle sbyte %tmp25, 122 ; <bool> [#uses=1] + br bool %tmp26, label %cond_true27, label %cond_next30 + +cond_true27: ; preds = %cond_true24 + call void %charsequence_reset( %struct.charsequence* %cs ) + %tmp28 = load sbyte* %c ; <sbyte> [#uses=1] + %tmp28 = sext sbyte %tmp28 to int ; <int> [#uses=1] + %tmp2829 = trunc int %tmp28 to sbyte ; <sbyte> [#uses=1] + call void %charsequence_push( %struct.charsequence* %cs, sbyte %tmp2829 ) + store int 1, int* %wstate + br label %cond_next30 + +cond_next30: ; preds = %cond_true27, %cond_true24 + br label %cond_next31 + +cond_next31: ; preds = %cond_next30, %cond_false + br label %cond_next32 + +cond_next32: ; preds = %cond_next31, %bb21 + br label %bb33 + +bb33: ; preds = %cond_next32, %entry + %tmp34 = load %struct.FILE** %f_addr ; <%struct.FILE*> [#uses=1] + %tmp35 = call int %feof( %struct.FILE* %tmp34 ) ; <int> [#uses=1] + %tmp36 = icmp eq int %tmp35, 0 ; <bool> [#uses=1] + br bool %tmp36, label %bb, label %bb37 + +bb37: ; preds = %bb33 + br label %return + +return: ; preds = %bb37 + ret void +} + diff --git a/test/Transforms/SimplifyCFG/DeadSetCC.ll b/test/Transforms/SimplifyCFG/DeadSetCC.ll index b180700..96337f7 100644 --- a/test/Transforms/SimplifyCFG/DeadSetCC.ll +++ b/test/Transforms/SimplifyCFG/DeadSetCC.ll @@ -1,4 +1,4 @@ -; RUN: llvm-upgrade < %s | llvm-as | opt -simplifycfg | llvm-dis | not grep seteq +; RUN: llvm-upgrade < %s | llvm-as | opt -simplifycfg | llvm-dis | not grep 'icmp eq' ; Check that simplifycfg deletes a dead 'seteq' instruction when it ; folds a conditional branch into a switch instruction. |