Remove tests: indvars trivially preserves GEPs now.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@153258 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Andrew Trick 2012-03-22 17:09:46 +00:00
parent 3730a8592d
commit f6399a65f0
4 changed files with 0 additions and 203 deletions

View File

@ -1,68 +0,0 @@
; RUN: opt < %s -indvars -S -enable-iv-rewrite | FileCheck %s
; CHECK: define void @foo
; CHECK: mul
; CHECK: mul
; CHECK: mul
; CHECK: add
; CHECK: sub
; CHECK: define void @bar
; CHECK: mul
; CHECK: mul
; CHECK: mul
; CHECK: add
; CHECK: sub
define void @foo(i64 %n, i64 %m, i64 %o, double* nocapture %p) nounwind {
entry:
%tmp = icmp sgt i64 %n, 0 ; <i1> [#uses=1]
br i1 %tmp, label %bb.nph, label %return
bb.nph: ; preds = %entry
%tmp1 = mul i64 %n, 37 ; <i64> [#uses=1]
%tmp2 = mul i64 %tmp1, %m ; <i64> [#uses=1]
%tmp3 = mul i64 %tmp2, %o ; <i64> [#uses=1]
br label %bb
bb: ; preds = %bb, %bb.nph
%i.01 = phi i64 [ %tmp3, %bb.nph ], [ %tmp13, %bb ] ; <i64> [#uses=3]
%tmp9 = getelementptr double* %p, i64 %i.01 ; <double*> [#uses=1]
%tmp10 = load double* %tmp9, align 8 ; <double> [#uses=1]
%tmp11 = fdiv double %tmp10, 2.100000e+00 ; <double> [#uses=1]
store double %tmp11, double* %tmp9, align 8
%tmp13 = add i64 %i.01, 1 ; <i64> [#uses=2]
%tmp14 = icmp slt i64 %tmp13, %n ; <i1> [#uses=1]
br i1 %tmp14, label %bb, label %return.loopexit
return.loopexit: ; preds = %bb
br label %return
return: ; preds = %return.loopexit, %entry
ret void
}
define void @bar(i64 %n, i64 %m, i64 %o, i64 %q, double* nocapture %p) nounwind {
entry:
%tmp = icmp sgt i64 %n, 0 ; <i1> [#uses=1]
br i1 %tmp, label %bb.nph, label %return
bb.nph: ; preds = %entry
%tmp1 = mul i64 %n, %q ; <i64> [#uses=1]
%tmp2 = mul i64 %tmp1, %m ; <i64> [#uses=1]
%tmp3 = mul i64 %tmp2, %o ; <i64> [#uses=1]
br label %bb
bb: ; preds = %bb, %bb.nph
%i.01 = phi i64 [ %tmp3, %bb.nph ], [ %tmp13, %bb ] ; <i64> [#uses=3]
%tmp9 = getelementptr double* %p, i64 %i.01 ; <double*> [#uses=1]
%tmp10 = load double* %tmp9, align 8 ; <double> [#uses=1]
%tmp11 = fdiv double %tmp10, 2.100000e+00 ; <double> [#uses=1]
store double %tmp11, double* %tmp9, align 8
%tmp13 = add i64 %i.01, 1 ; <i64> [#uses=2]
%tmp14 = icmp slt i64 %tmp13, %n ; <i1> [#uses=1]
br i1 %tmp14, label %bb, label %return.loopexit
return.loopexit: ; preds = %bb
br label %return
return: ; preds = %return.loopexit, %entry
ret void
}

View File

@ -1,76 +0,0 @@
; RUN: opt < %s -indvars -S -enable-iv-rewrite | FileCheck %s
; No explicit integer multiplications!
; No i8* arithmetic or pointer casting anywhere!
; CHECK-NOT: = {{= mul|i8\*|bitcast|inttoptr|ptrtoint}}
; Exactly one getelementptr for each load+store.
; Each getelementptr using %struct.Q* %s as a base and not i8*.
; CHECK: getelementptr %struct.Q* %s,
; CHECK: getelementptr %struct.Q* %s,
; CHECK: getelementptr %struct.Q* %s,
; CHECK: getelementptr %struct.Q* %s,
; CHECK: getelementptr %struct.Q* %s,
; CHECK: getelementptr %struct.Q* %s,
; CHECK-NOT: = {{= mul|i8\*|bitcast|inttoptr|ptrtoint}}
; FIXME: This test should pass with or without TargetData. Until opt
; supports running tests without targetdata, just hardware this in.
target datalayout = "e-p:64:64:64-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f32:32:32-f64:64:64-v64:64:64-v128:128:128-a0:0:64-s0:64:64-f80:128:128-n32:64"
%struct.Q = type { [10 x %struct.N] }
%struct.N = type { %struct.S }
%struct.S = type { [100 x double], [100 x double] }
define void @foo(%struct.Q* %s, i64 %n) nounwind {
entry:
br label %bb1
bb1:
%i = phi i64 [ 2, %entry ], [ %i.next, %bb ]
%j = phi i64 [ 0, %entry ], [ %j.next, %bb ]
%t5 = icmp slt i64 %i, %n
br i1 %t5, label %bb, label %return
bb:
%t0 = getelementptr inbounds %struct.Q* %s, i64 0, i32 0, i64 0, i32 0, i32 0, i64 %i
%t1 = load double* %t0, align 8
%t2 = fmul double %t1, 3.200000e+00
%t3 = getelementptr inbounds %struct.Q* %s, i64 0, i32 0, i64 0, i32 0, i32 0, i64 %i
store double %t2, double* %t3, align 8
%s0 = getelementptr inbounds %struct.Q* %s, i64 13, i32 0, i64 7, i32 0, i32 1, i64 %i
%s1 = load double* %s0, align 8
%s2 = fmul double %s1, 3.200000e+00
%s3 = getelementptr inbounds %struct.Q* %s, i64 13, i32 0, i64 7, i32 0, i32 1, i64 %i
store double %s2, double* %s3, align 8
%u0 = getelementptr inbounds %struct.Q* %s, i64 0, i32 0, i64 7, i32 0, i32 1, i64 %j
%u1 = load double* %u0, align 8
%u2 = fmul double %u1, 3.200000e+00
%u3 = getelementptr inbounds %struct.Q* %s, i64 0, i32 0, i64 7, i32 0, i32 1, i64 %j
store double %u2, double* %u3, align 8
%v0 = getelementptr inbounds %struct.Q* %s, i64 0, i32 0, i64 0, i32 0, i32 1, i64 %i
%v1 = load double* %v0, align 8
%v2 = fmul double %v1, 3.200000e+00
%v3 = getelementptr inbounds %struct.Q* %s, i64 0, i32 0, i64 0, i32 0, i32 1, i64 %i
store double %v2, double* %v3, align 8
%w0 = getelementptr inbounds %struct.Q* %s, i64 0, i32 0, i64 0, i32 0, i32 0, i64 %j
%w1 = load double* %w0, align 8
%w2 = fmul double %w1, 3.200000e+00
%w3 = getelementptr inbounds %struct.Q* %s, i64 0, i32 0, i64 0, i32 0, i32 0, i64 %j
store double %w2, double* %w3, align 8
%x0 = getelementptr inbounds %struct.Q* %s, i64 0, i32 0, i64 3, i32 0, i32 0, i64 %i
%x1 = load double* %x0, align 8
%x2 = fmul double %x1, 3.200000e+00
%x3 = getelementptr inbounds %struct.Q* %s, i64 0, i32 0, i64 3, i32 0, i32 0, i64 %i
store double %x2, double* %x3, align 8
%i.next = add i64 %i, 1
%j.next = add i64 %j, 1
br label %bb1
return:
ret void
}

View File

@ -1,20 +0,0 @@
; RUN: opt < %s -indvars -S -enable-iv-rewrite | FileCheck %s
; CHECK: %p.2.ip.1 = getelementptr [3 x [3 x double]]* %p, i64 2, i64 %0, i64 1
target datalayout = "E-p:64:64:64-a0:0:8-f32:32:32-f64:64:64-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:32:64-v64:64:64-v128:128:128-n32:64"
; Indvars shouldn't expand this to
; %p.2.ip.1 = getelementptr [3 x [3 x double]]* %p, i64 0, i64 %tmp, i64 19
; or something. That's valid, but more obscure.
define void @foo([3 x [3 x double]]* noalias %p) nounwind {
entry:
br label %loop
loop:
%i = phi i64 [ 0, %entry ], [ %i.next, %loop ]
%ip = add i64 %i, 1
%p.2.ip.1 = getelementptr [3 x [3 x double]]* %p, i64 2, i64 %ip, i64 1
store volatile double 0.0, double* %p.2.ip.1
%i.next = add i64 %i, 1
br label %loop
}

View File

@ -1,39 +0,0 @@
; RUN: opt < %s -indvars -S -enable-iv-rewrite | FileCheck %s
; CHECK-NOT: {{ptrtoint|inttoptr}}
; CHECK: getelementptr
; CHECK-NOT: {{ptrtoint|inttoptr|getelementptr}}
; Indvars shouldn't leave getelementptrs expanded out as
; inttoptr+ptrtoint in its output in common cases.
target datalayout = "e-p:64:64:64-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f32:32:32-f64:64:64-v64:64:64-v128:128:128-a0:0:64-s0:64:64-f80:128:128-n32:64"
target triple = "x86_64-unknown-linux-gnu"
%struct.Foo = type { i32, i32, [10 x i32], i32 }
define void @me(%struct.Foo* nocapture %Bar) nounwind {
entry:
br i1 false, label %return, label %bb.nph
bb.nph: ; preds = %entry
br label %bb
bb: ; preds = %bb1, %bb.nph
%i.01 = phi i64 [ %4, %bb1 ], [ 0, %bb.nph ] ; <i64> [#uses=3]
%0 = getelementptr %struct.Foo* %Bar, i64 %i.01, i32 2, i64 3 ; <i32*> [#uses=1]
%1 = load i32* %0, align 4 ; <i32> [#uses=1]
%2 = mul i32 %1, 113 ; <i32> [#uses=1]
%3 = getelementptr %struct.Foo* %Bar, i64 %i.01, i32 2, i64 3 ; <i32*> [#uses=1]
store i32 %2, i32* %3, align 4
%4 = add i64 %i.01, 1 ; <i64> [#uses=2]
br label %bb1
bb1: ; preds = %bb
%phitmp = icmp sgt i64 %4, 19999 ; <i1> [#uses=1]
br i1 %phitmp, label %bb1.return_crit_edge, label %bb
bb1.return_crit_edge: ; preds = %bb1
br label %return
return: ; preds = %bb1.return_crit_edge, %entry
ret void
}