summaryrefslogtreecommitdiffstats
path: root/llvm/test/Transforms/LoopIndexSplit/2007-09-25-UpdateIterationSpace-2.ll
diff options
context:
space:
mode:
authorDevang Patel <dpatel@apple.com>2008-12-04 21:38:42 +0000
committerDevang Patel <dpatel@apple.com>2008-12-04 21:38:42 +0000
commitc56423b500eba5a8b0b33beca76e0f2585b9d08d (patch)
tree873553e428c04c1a51960bc3d0a8ba45ac59819a /llvm/test/Transforms/LoopIndexSplit/2007-09-25-UpdateIterationSpace-2.ll
parent0bcbe8f6a8dd1514da5a9418a8882442a2827c56 (diff)
downloadbcm5719-llvm-c56423b500eba5a8b0b33beca76e0f2585b9d08d.tar.gz
bcm5719-llvm-c56423b500eba5a8b0b33beca76e0f2585b9d08d.zip
Rewrite code that 1) filters loops and 2) calculates new loop bounds.
This fixes many bugs. I will add more test cases in a separate check-in. Some day, the code that manipulates CFG and updates dom. info could use refactoring help. llvm-svn: 60554
Diffstat (limited to 'llvm/test/Transforms/LoopIndexSplit/2007-09-25-UpdateIterationSpace-2.ll')
-rw-r--r--llvm/test/Transforms/LoopIndexSplit/2007-09-25-UpdateIterationSpace-2.ll17
1 files changed, 9 insertions, 8 deletions
diff --git a/llvm/test/Transforms/LoopIndexSplit/2007-09-25-UpdateIterationSpace-2.ll b/llvm/test/Transforms/LoopIndexSplit/2007-09-25-UpdateIterationSpace-2.ll
index 06f9e110967..7d9378512aa 100644
--- a/llvm/test/Transforms/LoopIndexSplit/2007-09-25-UpdateIterationSpace-2.ll
+++ b/llvm/test/Transforms/LoopIndexSplit/2007-09-25-UpdateIterationSpace-2.ll
@@ -1,6 +1,7 @@
; PR714
; Update loop iteraton space to eliminate condition inside loop.
; RUN: llvm-as < %s | opt -loop-index-split | llvm-dis | not grep bothcond
+
define void @test(float* %x, i32 %ndat, float** %y, float %xcen, i32 %xmin, i32 %xmax, float %sigmal, float %contribution) {
entry:
%tmp5310 = icmp sgt i32 %xmin, %xmax ; <i1> [#uses=1]
@@ -12,9 +13,9 @@ bb.preheader: ; preds = %entry
%tmp3839 = fpext float %sigmal to double ; <double> [#uses=1]
br label %bb
-bb: ; preds = %bb.preheader, %cond_next45
- %i.01.0 = phi i32 [ %tmp47, %cond_next45 ], [ %xmin, %bb.preheader ] ; <i32> [#uses=4]
- %k.06.0 = phi i32 [ %tmp49, %cond_next45 ], [ 0, %bb.preheader ] ; <i32> [#uses=3]
+bb: ; preds = %cond_next45, %bb.preheader
+ %k.06.0 = phi i32 [ 0, %bb.preheader ], [ %indvar.next, %cond_next45 ] ; <i32> [#uses=4]
+ %i.01.0 = add i32 %k.06.0, %xmin ; <i32> [#uses=4]
%tmp2 = icmp sgt i32 %i.01.0, -1 ; <i1> [#uses=1]
%tmp6 = icmp slt i32 %i.01.0, %ndat ; <i1> [#uses=1]
%bothcond = and i1 %tmp2, %tmp6 ; <i1> [#uses=1]
@@ -24,7 +25,7 @@ cond_true9: ; preds = %bb
%tmp12 = getelementptr float* %x, i32 %i.01.0 ; <float*> [#uses=1]
%tmp13 = load float* %tmp12, align 4 ; <float> [#uses=1]
%tmp15 = sub float %xcen, %tmp13 ; <float> [#uses=1]
- %tmp16 = tail call float @fabsf( float %tmp15 ) ; <float> [#uses=1]
+ %tmp16 = tail call float @fabsf(float %tmp15) ; <float> [#uses=1]
%tmp18 = fdiv float %tmp16, %sigmal ; <float> [#uses=1]
%tmp21 = load float** %y, align 4 ; <float*> [#uses=2]
%tmp27 = getelementptr float* %tmp21, i32 %k.06.0 ; <float*> [#uses=1]
@@ -32,7 +33,7 @@ cond_true9: ; preds = %bb
%tmp2829 = fpext float %tmp28 to double ; <double> [#uses=1]
%tmp34 = sub float -0.000000e+00, %tmp18 ; <float> [#uses=1]
%tmp3435 = fpext float %tmp34 to double ; <double> [#uses=1]
- %tmp36 = tail call double @exp( double %tmp3435 ) ; <double> [#uses=1]
+ %tmp36 = tail call double @exp(double %tmp3435) ; <double> [#uses=1]
%tmp37 = mul double %tmp32, %tmp36 ; <double> [#uses=1]
%tmp40 = fdiv double %tmp37, %tmp3839 ; <double> [#uses=1]
%tmp41 = add double %tmp2829, %tmp40 ; <double> [#uses=1]
@@ -41,10 +42,10 @@ cond_true9: ; preds = %bb
store float %tmp4142, float* %tmp44, align 4
br label %cond_next45
-cond_next45: ; preds = %bb, %cond_true9
- %tmp47 = add i32 %i.01.0, 1 ; <i32> [#uses=2]
- %tmp49 = add i32 %k.06.0, 1 ; <i32> [#uses=1]
+cond_next45: ; preds = %cond_true9, %bb
+ %tmp47 = add i32 %i.01.0, 1 ; <i32> [#uses=1]
%tmp53 = icmp sgt i32 %tmp47, %xmax ; <i1> [#uses=1]
+ %indvar.next = add i32 %k.06.0, 1 ; <i32> [#uses=1]
br i1 %tmp53, label %return.loopexit, label %bb
return.loopexit: ; preds = %cond_next45
OpenPOWER on IntegriCloud