Clean up XFAILed test cases

We had a set of test cases that have been incomplete and XFAILED. This patch
completes a couple of the interesting ones and removes the ones which seem
redundant or not sufficiently reduced to be useful.

llvm-svn: 211670
This commit is contained in:
Tobias Grosser 2014-06-25 06:31:19 +00:00
parent 736d4d85db
commit 08031390d5
11 changed files with 105 additions and 453 deletions

View File

@ -1,41 +0,0 @@
; RUN: opt %loadPolly %defaultOpts -polly-analyze-ir -analyze < %s | FileCheck %s
; RUN: opt %loadPolly %defaultOpts -polly-analyze-ir -analyze < %s | FileCheck %s
; XFAIL: *
;void f(long a[], long N) {
; long i;
; for (i = 0; i < N; ++i)
; a[i] = i;
; a[2 *i + 5 ] = 0;
;}
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"
target triple = "x86_64-unknown-linux-gnu"
define void @f(i64* nocapture %a, i64 %N) nounwind {
entry:
%0 = icmp sgt i64 %N, 0 ; <i1> [#uses=1]
br i1 %0, label %bb, label %bb2
bb: ; preds = %bb, %entry
%1 = phi i64 [ 0, %entry ], [ %2, %bb ] ; <i64> [#uses=3]
%scevgep = getelementptr i64* %a, i64 %1 ; <i64*> [#uses=1]
store i64 %1, i64* %scevgep, align 8
%2 = add nsw i64 %1, 1 ; <i64> [#uses=2]
%exitcond = icmp eq i64 %2, %N ; <i1> [#uses=1]
br i1 %exitcond, label %bb1.bb2_crit_edge, label %bb
bb1.bb2_crit_edge: ; preds = %bb
%phitmp = shl i64 %N, 1 ; <i64> [#uses=1]
%phitmp5 = add i64 %phitmp, 5 ; <i64> [#uses=1]
br label %bb2
bb2: ; preds = %bb1.bb2_crit_edge, %entry
%i.0.lcssa = phi i64 [ %phitmp5, %bb1.bb2_crit_edge ], [ 5, %entry ] ; <i64> [#uses=1]
%3 = getelementptr inbounds i64* %a, i64 %i.0.lcssa ; <i64*> [#uses=1]
store i64 0, i64* %3, align 8
ret void
}
; CHECK: Scop: entry => <Function Return> Parameters: (%N, )

View File

@ -1,47 +0,0 @@
; RUN: opt %loadPolly %defaultOpts -polly-analyze-ir -analyze < %s | FileCheck %s
; RUN: opt %loadPolly %defaultOpts -polly-analyze-ir -analyze < %s | FileCheck %s
; XFAIL: *
;void f(long a[], long N) {
; long i;
; for (i = 0; i < N; ++i)
; a[i] = i;
; if (N > 0)
; a[2 * N + 5 ] = 0;
; else
; a[5] = 0;
;}
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"
target triple = "x86_64-unknown-linux-gnu"
define void @f(i64* nocapture %a, i64 %N) nounwind {
entry:
%0 = icmp sgt i64 %N, 0 ; <i1> [#uses=2]
br i1 %0, label %bb, label %bb4
bb: ; preds = %bb, %entry
%1 = phi i64 [ 0, %entry ], [ %2, %bb ] ; <i64> [#uses=3]
%scevgep = getelementptr i64* %a, i64 %1 ; <i64*> [#uses=1]
store i64 %1, i64* %scevgep, align 8
%2 = add nsw i64 %1, 1 ; <i64> [#uses=2]
%exitcond = icmp eq i64 %2, %N ; <i1> [#uses=1]
br i1 %exitcond, label %bb2, label %bb
bb2: ; preds = %bb
br i1 %0, label %bb3, label %bb4
bb3: ; preds = %bb2
%3 = shl i64 %N, 1 ; <i64> [#uses=1]
%4 = add nsw i64 %3, 5 ; <i64> [#uses=1]
%5 = getelementptr inbounds i64* %a, i64 %4 ; <i64*> [#uses=1]
store i64 0, i64* %5, align 8
ret void
bb4: ; preds = %bb2, %entry
%6 = getelementptr inbounds i64* %a, i64 5 ; <i64*> [#uses=1]
store i64 0, i64* %6, align 8
ret void
}
; CHECK: Scop: entry => <Function Return> Parameters: (%N, )

View File

@ -1,45 +0,0 @@
; RUN: opt %loadPolly %defaultOpts -polly-analyze-ir -analyze < %s | FileCheck %s
; RUN: opt %loadPolly %defaultOpts -polly-analyze-ir -analyze < %s | FileCheck %s
; XFAIL: *
;void f(long a[], long N, long M) {
; long i;
; if (N > M)
; for (i = 0; i < N; ++i)
; a[i] = i;
; else
; i = M + 3;
; a[2 *i + 5 ] = 0;
;}
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"
target triple = "x86_64-unknown-linux-gnu"
define void @f(i64* nocapture %a, i64 %N) nounwind {
entry:
%0 = icmp sgt i64 %N, 0 ; <i1> [#uses=1]
br i1 %0, label %bb, label %bb2
bb: ; preds = %bb, %entry
%1 = phi i64 [ 0, %entry ], [ %2, %bb ] ; <i64> [#uses=3]
%scevgep = getelementptr i64* %a, i64 %1 ; <i64*> [#uses=1]
store i64 %1, i64* %scevgep, align 8
%2 = add nsw i64 %1, 1 ; <i64> [#uses=2]
%exitcond = icmp eq i64 %2, %N ; <i1> [#uses=1]
br i1 %exitcond, label %bb1.bb2_crit_edge, label %bb
bb1.bb2_crit_edge: ; preds = %bb
%phitmp = shl i64 %N, 1 ; <i64> [#uses=1]
%phitmp5 = add i64 %phitmp, 5 ; <i64> [#uses=1]
br label %bb2
bb2: ; preds = %bb1.bb2_crit_edge, %entry
%i.0.lcssa = phi i64 [ %phitmp5, %bb1.bb2_crit_edge ], [ 5, %entry ] ; <i64> [#uses=1]
%3 = getelementptr inbounds i64* %a, i64 %i.0.lcssa ; <i64*> [#uses=1]
store i64 0, i64* %3, align 8
ret void
}
; CHECK: Scop: entry => <Function Return> Parameters: (%N, %M )

View File

@ -1,13 +1,11 @@
; RUN: opt %loadPolly %defaultOpts -polly-analyze-ir -analyze < %s | FileCheck %s
; RUN: opt %loadPolly %defaultOpts -polly-analyze-ir -analyze < %s | FileCheck %s
; XFAIL: *
; RUN: opt %loadPolly -polly-scops -analyze < %s | FileCheck %s
;void f(long a[][128], long N, long M) {
; long i, j;
; for (j = 0; j < (4*N + 7*M +3); ++j)
; for (i = 0; i < (5*N + 2); ++i)
; ...
;}
; void f(long a[][128], long N, long M) {
; long i, j;
; for (j = 0; j < (4*N + 7*M +3); ++j)
; for (i = 0; i < (5*N + 2); ++i)
; a[j][i] = 0
; }
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"
target triple = "x86_64-unknown-linux-gnu"
@ -53,4 +51,15 @@ return: ; preds = %bb.nph8, %bb3, %ent
ret void
}
; CHECK: entry => <Function Return> Parameters: (%N, %M, )
; CHECK: p0: %N
; CHECK: p1: %M
; CHECK: Statements {
; CHECK: Stmt_bb1
; CHECK: Domain :=
; CHECK: [N, M] -> { Stmt_bb1[i0, i1] : i0 >= 0 and i0 <= 2 + 4N + 7M and i1 >= 0 and i1 <= 1 + 5N and N >= 0 };
; CHECK: Scattering :=
; CHECK: [N, M] -> { Stmt_bb1[i0, i1] -> scattering[0, i0, 0, i1, 0] };
; CHECK: Reduction like: 0
; CHECK: MustWriteAccess :=
; CHECK: [N, M] -> { Stmt_bb1[i0, i1] -> MemRef_a[i0 + 128i1] };
; CHECK: }

View File

@ -1,6 +1,5 @@
; RUN: opt %loadPolly %defaultOpts -polly-analyze-ir -analyze < %s | FileCheck %s
; RUN: opt %loadPolly %defaultOpts -polly-analyze-ir -analyze < %s | FileCheck %s
; XFAIL: *
; RUN: opt %loadPolly -polly-scops -analyze < %s | FileCheck %s
;void f(long a[][128], long N, long M) {
; long i, j;
; for (j = 0; j < (4*N + 7*M +3); ++j)
@ -51,4 +50,15 @@ return: ; preds = %bb3, %entry
ret void
}
; CHECK: entry => <Function Return> Parameters: (%N, %M, )
; CHECK: p0: %N
; CHECK: p1: %M
; CHECK: Statements {
; CHECK: Stmt_bb1
; CHECK: Domain :=
; CHECK: [N, M] -> { Stmt_bb1[i0, i1] : i0 >= 0 and i0 <= 2 + 4N + 7M and i1 >= 0 and i1 <= 1 + 5N - i0 and i0 <= 1 + 5N };
; CHECK: Scattering :=
; CHECK: [N, M] -> { Stmt_bb1[i0, i1] -> scattering[0, i0, 0, i1, 0] };
; CHECK: Reduction like: 0
; CHECK: MustWriteAccess :=
; CHECK: [N, M] -> { Stmt_bb1[i0, i1] -> MemRef_a[129i0 + 128i1] };
; CHECK: }

View File

@ -1,65 +1,75 @@
; RUN: opt %loadPolly %defaultOpts -polly-analyze-ir -analyze < %s | FileCheck %s
; RUN: opt %loadPolly %defaultOpts -polly-analyze-ir -analyze < %s | FileCheck %s
; XFAIL: *
;void f(long a[][128], long N, long M) {
; long i, j;
; for (j = 0; j < (4*N + 7*M +3); ++j)
; for (i = (7*j + 6*M -9); i < (3*j + 5*N + 2) ; ++i)
; a[i][j] = 0;
;}
; RUN: opt %loadPolly -polly-scops -analyze < %s | FileCheck %s
; void f(long a[][128], long N, long M) {
; long i, j;
; for (j = 0; j < (4*N + 7*M +3); ++j)
; for (i = (7*j + 6*M -9); i < (3*j + 5*N + 2) ; ++i)
; a[i][j] = 0;
; }
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"
target triple = "x86_64-unknown-linux-gnu"
define void @f([128 x i64]* nocapture %a, i64 %N, i64 %M) nounwind {
entry:
%0 = shl i64 %N, 2 ; <i64> [#uses=2]
%1 = mul i64 %M, 7 ; <i64> [#uses=2]
%2 = or i64 %0, 3 ; <i64> [#uses=1]
%3 = add nsw i64 %2, %1 ; <i64> [#uses=1]
%4 = icmp sgt i64 %3, 0 ; <i1> [#uses=1]
%0 = shl i64 %N, 2
%1 = mul i64 %M, 7
%2 = or i64 %0, 3
%3 = add nsw i64 %2, %1
%4 = icmp sgt i64 %3, 0
br i1 %4, label %bb.nph8, label %return
bb.nph8: ; preds = %entry
%tmp14 = mul i64 %M, 6 ; <i64> [#uses=1]
%tmp15 = add i64 %tmp14, -9 ; <i64> [#uses=2]
%tmp20 = add i64 %1, %0 ; <i64> [#uses=1]
%tmp21 = add i64 %tmp20, 3 ; <i64> [#uses=1]
%tmp25 = mul i64 %M, -6 ; <i64> [#uses=1]
%tmp26 = mul i64 %N, 5 ; <i64> [#uses=2]
%tmp27 = add i64 %tmp25, %tmp26 ; <i64> [#uses=1]
%tmp28 = add i64 %tmp27, 11 ; <i64> [#uses=1]
%tmp35 = add i64 %tmp26, 2 ; <i64> [#uses=1]
%tmp14 = mul i64 %M, 6
%tmp15 = add i64 %tmp14, -9
%tmp20 = add i64 %1, %0
%tmp21 = add i64 %tmp20, 3
%tmp25 = mul i64 %M, -6
%tmp26 = mul i64 %N, 5
%tmp27 = add i64 %tmp25, %tmp26
%tmp28 = add i64 %tmp27, 11
%tmp35 = add i64 %tmp26, 2
br label %bb
bb: ; preds = %bb3, %bb.nph8
%j.07 = phi i64 [ 0, %bb.nph8 ], [ %6, %bb3 ] ; <i64> [#uses=5]
%tmp17 = mul i64 %j.07, 897 ; <i64> [#uses=1]
%tmp24 = mul i64 %j.07, -4 ; <i64> [#uses=1]
%tmp13 = add i64 %tmp24, %tmp28 ; <i64> [#uses=1]
%tmp30 = mul i64 %j.07, 7 ; <i64> [#uses=1]
%tmp33 = add i64 %tmp30, %tmp15 ; <i64> [#uses=1]
%tmp34 = mul i64 %j.07, 3 ; <i64> [#uses=1]
%tmp36 = add i64 %tmp34, %tmp35 ; <i64> [#uses=1]
%5 = icmp sgt i64 %tmp36, %tmp33 ; <i1> [#uses=1]
%j.07 = phi i64 [ 0, %bb.nph8 ], [ %6, %bb3 ]
%tmp17 = mul i64 %j.07, 897
%tmp24 = mul i64 %j.07, -4
%tmp13 = add i64 %tmp24, %tmp28
%tmp30 = mul i64 %j.07, 7
%tmp33 = add i64 %tmp30, %tmp15
%tmp34 = mul i64 %j.07, 3
%tmp36 = add i64 %tmp34, %tmp35
%5 = icmp sgt i64 %tmp36, %tmp33
br i1 %5, label %bb1, label %bb3
bb1: ; preds = %bb1, %bb
%indvar = phi i64 [ 0, %bb ], [ %indvar.next, %bb1 ] ; <i64> [#uses=2]
%tmp16 = add i64 %indvar, %tmp15 ; <i64> [#uses=1]
%scevgep = getelementptr [128 x i64]* %a, i64 %tmp16, i64 %tmp17 ; <i64*> [#uses=1]
store i64 0, i64* %scevgep, align 8
%indvar.next = add i64 %indvar, 1 ; <i64> [#uses=2]
%exitcond = icmp eq i64 %indvar.next, %tmp13 ; <i1> [#uses=1]
%indvar = phi i64 [ 0, %bb ], [ %indvar.next, %bb1 ]
%tmp16 = add i64 %indvar, %tmp15
%scevgep = getelementptr [128 x i64]* %a, i64 %tmp16, i64 %tmp17
store i64 0, i64* %scevgep
%indvar.next = add i64 %indvar, 1
%exitcond = icmp eq i64 %indvar.next, %tmp13
br i1 %exitcond, label %bb3, label %bb1
bb3: ; preds = %bb1, %bb
%6 = add nsw i64 %j.07, 1 ; <i64> [#uses=2]
%exitcond22 = icmp eq i64 %6, %tmp21 ; <i1> [#uses=1]
%6 = add nsw i64 %j.07, 1
%exitcond22 = icmp eq i64 %6, %tmp21
br i1 %exitcond22, label %return, label %bb
return: ; preds = %bb3, %entry
ret void
}
; CHECK: Scop: entry => <Function Return> Parameters: (%M, %N, ), Max Loop Depth: 2
; CHECK: p0: %N
; CHECK: p1: %M
; CHECK: Statements {
; CHECK: Stmt_bb1
; CHECK: Domain :=
; CHECK: [N, M] -> { Stmt_bb1[i0, i1] : i0 >= 0 and i0 <= 2 + 4N + 7M and i1 >= 0 and i1 <= 10 + 5N - 6M - 4i0 and 4i0 <= 10 + 5N - 6M };
; CHECK: Scattering :=
; CHECK: [N, M] -> { Stmt_bb1[i0, i1] -> scattering[0, i0, 0, i1, 0] };
; CHECK: Reduction like: 0
; CHECK: MustWriteAccess :=
; CHECK: [N, M] -> { Stmt_bb1[i0, i1] -> MemRef_a[-1152 + 768M + 897i0 + 128i1] };
; CHECK: }

View File

@ -1,57 +0,0 @@
; RUN: opt %loadPolly %defaultOpts -polly-analyze-ir -analyze < %s | FileCheck %s
; RUN: opt %loadPolly %defaultOpts -polly-analyze-ir -analyze < %s | FileCheck %s
; XFAIL: *
;void f(long a[][128], long N, long M) {
; long i, j;
; for (j = 0; j < (4*N + 7*M +3); ++j)
; for (i = 0; i < (5*N*M + 2); ++i)
; ...
;}
define void @f([128 x i64]* nocapture %a, i64 %N, i64 %M) nounwind {
entry:
%0 = shl i64 %N, 2 ; <i64> [#uses=2]
%1 = mul i64 %M, 7 ; <i64> [#uses=2]
%2 = or i64 %0, 3 ; <i64> [#uses=1]
%3 = add nsw i64 %2, %1 ; <i64> [#uses=1]
%4 = icmp sgt i64 %3, 0 ; <i1> [#uses=1]
br i1 %4, label %bb.nph8, label %return
bb1: ; preds = %bb2.preheader, %bb1
%i.06 = phi i64 [ 0, %bb2.preheader ], [ %5, %bb1 ] ; <i64> [#uses=2]
%scevgep = getelementptr [128 x i64]* %a, i64 %i.06, i64 %11 ; <i64*> [#uses=1]
store i64 0, i64* %scevgep, align 8
%5 = add nsw i64 %i.06, 1 ; <i64> [#uses=2]
%exitcond = icmp eq i64 %5, %tmp10 ; <i1> [#uses=1]
br i1 %exitcond, label %bb3, label %bb1
bb3: ; preds = %bb1
%6 = add i64 %11, 1 ; <i64> [#uses=2]
%exitcond15 = icmp eq i64 %6, %tmp14 ; <i1> [#uses=1]
br i1 %exitcond15, label %return, label %bb2.preheader
bb.nph8: ; preds = %entry
%7 = mul i64 %N, 5 ; <i64> [#uses=1]
%8 = mul i64 %7, %M ; <i64> [#uses=1]
%9 = add nsw i64 %8, 2 ; <i64> [#uses=1]
%10 = icmp sgt i64 %9, 0 ; <i1> [#uses=1]
br i1 %10, label %bb.nph8.split, label %return
bb.nph8.split: ; preds = %bb.nph8
%tmp = mul i64 %M, %N ; <i64> [#uses=1]
%tmp9 = mul i64 %tmp, 5 ; <i64> [#uses=1]
%tmp10 = add i64 %tmp9, 2 ; <i64> [#uses=1]
%tmp13 = add i64 %1, %0 ; <i64> [#uses=1]
%tmp14 = add i64 %tmp13, 3 ; <i64> [#uses=1]
br label %bb2.preheader
bb2.preheader: ; preds = %bb.nph8.split, %bb3
%11 = phi i64 [ 0, %bb.nph8.split ], [ %6, %bb3 ] ; <i64> [#uses=2]
br label %bb1
return: ; preds = %bb.nph8, %bb3, %entry
ret void
}
; CHECK: TO BE WRITTEN

View File

@ -1,56 +0,0 @@
; RUN: opt %loadPolly %defaultOpts -polly-analyze-ir -analyze < %s | FileCheck %s
; XFAIL: *
;void f(long a[][128], long N, long M) {
; long i, j, k;
; for (j = 0; j < M; ++j)
; for (i = 0; i < N; ++i)
; a[i][j] = 4*i+5;
; for (k = 0; k < 64; ++k)
; a[4][k] = a[k][4];
;}
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"
target triple = "x86_64-unknown-linux-gnu"
define void @f([128 x i64]* nocapture %a, i64 %N, i64 %M) nounwind {
entry:
%0 = icmp sgt i64 %M, 0 ; <i1> [#uses=1]
%1 = icmp sgt i64 %N, 0 ; <i1> [#uses=1]
%or.cond = and i1 %0, %1 ; <i1> [#uses=1]
br i1 %or.cond, label %bb2.preheader, label %bb6
bb1: ; preds = %bb2.preheader, %bb1
%i.010 = phi i64 [ 0, %bb2.preheader ], [ %2, %bb1 ] ; <i64> [#uses=3]
%tmp = shl i64 %i.010, 2 ; <i64> [#uses=1]
%tmp16 = add i64 %tmp, 5 ; <i64> [#uses=1]
%scevgep17 = getelementptr [128 x i64]* %a, i64 %i.010, i64 %4 ; <i64*> [#uses=1]
store i64 %tmp16, i64* %scevgep17, align 8
%2 = add nsw i64 %i.010, 1 ; <i64> [#uses=2]
%exitcond15 = icmp eq i64 %2, %N ; <i1> [#uses=1]
br i1 %exitcond15, label %bb3, label %bb1
bb3: ; preds = %bb1
%3 = add i64 %4, 1 ; <i64> [#uses=2]
%exitcond18 = icmp eq i64 %3, %M ; <i1> [#uses=1]
br i1 %exitcond18, label %bb6, label %bb2.preheader
bb2.preheader: ; preds = %bb3, %entry
%4 = phi i64 [ %3, %bb3 ], [ 0, %entry ] ; <i64> [#uses=2]
br label %bb1
bb6: ; preds = %bb6, %bb3, %entry
%k.09 = phi i64 [ %6, %bb6 ], [ 0, %bb3 ], [ 0, %entry ] ; <i64> [#uses=3]
%scevgep = getelementptr [128 x i64]* %a, i64 4, i64 %k.09 ; <i64*> [#uses=1]
%scevgep14 = getelementptr [128 x i64]* %a, i64 %k.09, i64 4 ; <i64*> [#uses=1]
%5 = load i64* %scevgep14, align 8 ; <i64> [#uses=1]
store i64 %5, i64* %scevgep, align 8
%6 = add nsw i64 %k.09, 1 ; <i64> [#uses=2]
%exitcond = icmp eq i64 %6, 64 ; <i1> [#uses=1]
br i1 %exitcond, label %return, label %bb6
return: ; preds = %bb6
ret void
}
; CHECK: Scop: entry => <Function Return> Parameters: (%N, %M, ), Max Loop Depth: 2

View File

@ -1,101 +0,0 @@
; RUN: opt %loadPolly %defaultOpts -polly-analyze-ir -analyze < %s | FileCheck %s -check-prefix=INDVAR
; RUN: opt %loadPolly %defaultOpts -polly-analyze-ir -analyze < %s | FileCheck %s
; XFAIL: *
;From pollybench.
;void f(long A[][128], long n) {
; long k, i, j;
; for (k = 0; k < n; k++) {
; for (j = k + 1; j < n; j++)
; A[k][j] = A[k][j] / A[k][k];
; for(i = k + 1; i < n; i++)
; for (j = k + 1; j < n; j++)
; A[i][j] = A[i][j] - A[i][k] * A[k][j];
; }
;}
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-n8:16:32:64"
target triple = "x86_64-linux-gnu"
define void @f([128 x i64]* nocapture %A, i64 %n) nounwind {
entry:
%0 = icmp sgt i64 %n, 0 ; <i1> [#uses=1]
br i1 %0, label %bb.nph30, label %return
bb.nph: ; preds = %bb2.preheader
%1 = getelementptr inbounds [128 x i64]* %A, i64 %k.023, i64 %k.023 ; <i64*> [#uses=1]
%tmp31 = sub i64 %tmp, %k.023 ; <i64> [#uses=1]
%tmp32 = mul i64 %k.023, 129 ; <i64> [#uses=1]
%tmp33 = add i64 %tmp32, 1 ; <i64> [#uses=1]
br label %bb1
bb1: ; preds = %bb1, %bb.nph
%indvar = phi i64 [ 0, %bb.nph ], [ %indvar.next, %bb1 ] ; <i64> [#uses=2]
%tmp34 = add i64 %tmp33, %indvar ; <i64> [#uses=1]
%scevgep = getelementptr [128 x i64]* %A, i64 0, i64 %tmp34 ; <i64*> [#uses=2]
%2 = load i64* %scevgep, align 8 ; <i64> [#uses=1]
%3 = load i64* %1, align 8 ; <i64> [#uses=1]
%4 = sdiv i64 %2, %3 ; <i64> [#uses=1]
store i64 %4, i64* %scevgep, align 8
%indvar.next = add i64 %indvar, 1 ; <i64> [#uses=2]
%exitcond = icmp eq i64 %indvar.next, %tmp31 ; <i1> [#uses=1]
br i1 %exitcond, label %bb8.loopexit, label %bb1
bb.nph16: ; preds = %bb.nph22, %bb8.loopexit12
%indvar39 = phi i64 [ 0, %bb.nph22 ], [ %tmp51, %bb8.loopexit12 ] ; <i64> [#uses=2]
%tmp48 = add i64 %j.013, %indvar39 ; <i64> [#uses=1]
%tmp51 = add i64 %indvar39, 1 ; <i64> [#uses=3]
%scevgep53 = getelementptr [128 x i64]* %A, i64 %tmp51, i64 %tmp52 ; <i64*> [#uses=1]
%tmp37 = sub i64 %n, %j.013 ; <i64> [#uses=1]
br label %bb5
bb5: ; preds = %bb5, %bb.nph16
%indvar35 = phi i64 [ 0, %bb.nph16 ], [ %indvar.next36, %bb5 ] ; <i64> [#uses=2]
%tmp49 = add i64 %j.013, %indvar35 ; <i64> [#uses=2]
%scevgep43 = getelementptr [128 x i64]* %A, i64 %tmp48, i64 %tmp49 ; <i64*> [#uses=2]
%scevgep44 = getelementptr [128 x i64]* %A, i64 %k.023, i64 %tmp49 ; <i64*> [#uses=1]
%5 = load i64* %scevgep43, align 8 ; <i64> [#uses=1]
%6 = load i64* %scevgep53, align 8 ; <i64> [#uses=1]
%7 = load i64* %scevgep44, align 8 ; <i64> [#uses=1]
%8 = mul nsw i64 %7, %6 ; <i64> [#uses=1]
%9 = sub nsw i64 %5, %8 ; <i64> [#uses=1]
store i64 %9, i64* %scevgep43, align 8
%indvar.next36 = add i64 %indvar35, 1 ; <i64> [#uses=2]
%exitcond38 = icmp eq i64 %indvar.next36, %tmp37 ; <i1> [#uses=1]
br i1 %exitcond38, label %bb8.loopexit12, label %bb5
bb8.loopexit: ; preds = %bb1
br i1 %10, label %bb.nph22, label %return
bb8.loopexit12: ; preds = %bb5
%exitcond47 = icmp eq i64 %tmp51, %tmp46 ; <i1> [#uses=1]
br i1 %exitcond47, label %bb10.loopexit, label %bb.nph16
bb.nph22: ; preds = %bb8.loopexit
%tmp46 = sub i64 %tmp, %k.023 ; <i64> [#uses=1]
%tmp52 = mul i64 %k.023, 129 ; <i64> [#uses=1]
br label %bb.nph16
bb10.loopexit: ; preds = %bb8.loopexit12
br i1 %10, label %bb2.preheader, label %return
bb.nph30: ; preds = %entry
%tmp = add i64 %n, -1 ; <i64> [#uses=2]
br label %bb2.preheader
bb2.preheader: ; preds = %bb.nph30, %bb10.loopexit
%k.023 = phi i64 [ 0, %bb.nph30 ], [ %j.013, %bb10.loopexit ] ; <i64> [#uses=8]
%j.013 = add i64 %k.023, 1 ; <i64> [#uses=5]
%10 = icmp slt i64 %j.013, %n ; <i1> [#uses=3]
br i1 %10, label %bb.nph, label %return
return: ; preds = %bb2.preheader, %bb10.loopexit, %bb8.loopexit, %entry
ret void
}
; CHECK: Scop: bb5 => bb8.loopexit12 Parameters: ({0,+,1}<%bb2.preheader>, %n, {0,+,1}<%bb.nph16>, ), Max Loop Depth: 1
; CHECK: Scop: bb.nph16 => bb10.loopexit Parameters: ({0,+,1}<%bb2.preheader>, %n, ), Max Loop Depth: 2
; CHECK: Scop: bb1 => bb8.loopexit Parameters: ({0,+,1}<%bb2.preheader>, %n, ), Max Loop Depth: 1
; INDVAR: Scop: bb1 => bb8.loopexit Parameters: ({0,+,1}<%bb2.preheader>, %n, ), Max Loop Depth: 1
; INDVAR: Scop: bb.nph16 => bb10.loopexit Parameters: ({0,+,1}<%bb2.preheader>, %n, ), Max Loop Depth: 2
; INDVAR: Scop: bb5 => bb8.loopexit12 Parameters: ({0,+,1}<%bb2.preheader>, %n, {0,+,1}<%bb.nph16>, ), Max Loop Depth: 1

View File

@ -1,35 +0,0 @@
; RUN: opt %loadPolly %defaultOpts -polly-analyze-ir -analyze < %s | FileCheck %s
; RUN: opt %loadPolly %defaultOpts -polly-analyze-ir -analyze < %s | FileCheck %s
; XFAIL: *
;void f(long a[], long N, long M) {
; long i;
; for (i = 0; i < N; ++i)
; a[i] = i;
; a[M] = 0;
;}
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"
target triple = "x86_64-unknown-linux-gnu"
define void @f(i64* nocapture %a, i64 %N, i64 %M) nounwind {
entry:
%0 = icmp sgt i64 %N, 0 ; <i1> [#uses=1]
br i1 %0, label %bb, label %bb2
bb: ; preds = %bb, %entry
%1 = phi i64 [ 0, %entry ], [ %2, %bb ] ; <i64> [#uses=3]
%scevgep = getelementptr i64* %a, i64 %1 ; <i64*> [#uses=1]
store i64 %1, i64* %scevgep, align 8
%2 = add nsw i64 %1, 1 ; <i64> [#uses=2]
%exitcond = icmp eq i64 %2, %N ; <i1> [#uses=1]
br i1 %exitcond, label %bb2, label %bb
bb2: ; preds = %bb, %entry
%3 = getelementptr inbounds i64* %a, i64 %M ; <i64*> [#uses=1]
store i64 0, i64* %3, align 8
ret void
}
; CHECK: Scop: entry => <Function Return> Parameters: (%N, %M, )

View File

@ -1,30 +1,35 @@
; RUN: opt %loadPolly %defaultOpts -polly-analyze-ir -analyze < %s | FileCheck %s
; RUN: opt %loadPolly %defaultOpts -polly-analyze-ir -analyze < %s | FileCheck %s
; XFAIL: *
;void f(int a[], int N) {
; int i;
; for (i = 0; i < N; ++i)
; ...
;}
; RUN: opt %loadPolly -polly-scops -analyze < %s | FileCheck %s
; void f(int a[], int N) {
; int i;
; for (i = 0; i < N; ++i)
; a[i] = i;
; }
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"
target triple = "x86_64-unknown-linux-gnu"
define void @f(i64* nocapture %a, i64 %N) nounwind {
entry:
%0 = icmp sgt i64 %N, 0 ; <i1> [#uses=1]
br i1 %0, label %bb, label %return
br label %bb
bb: ; preds = %bb, %entry
%1 = phi i64 [ 0, %entry ], [ %2, %bb ] ; <i64> [#uses=3]
%scevgep = getelementptr i64* %a, i64 %1 ; <i64*> [#uses=1]
store i64 %1, i64* %scevgep, align 8
%2 = add nsw i64 %1, 1 ; <i64> [#uses=2]
%exitcond = icmp eq i64 %2, %N ; <i1> [#uses=1]
%i = phi i64 [ 0, %entry ], [ %i.inc, %bb ]
%scevgep = getelementptr i64* %a, i64 %i
store i64 %i, i64* %scevgep
%i.inc = add nsw i64 %i, 1
%exitcond = icmp eq i64 %i.inc, %N
br i1 %exitcond, label %return, label %bb
return: ; preds = %bb, %entry
ret void
}
; CHECK: Scop: entry => <Function Return> Parameters: (%N, )
; CHECK: Stmt_bb
; CHECK: Domain :=
; CHECK: [N] -> { Stmt_bb[i0] : i0 >= 0 and i0 <= -1 + N };
; CHECK: Scattering :=
; CHECK: [N] -> { Stmt_bb[i0] -> scattering[0, i0, 0] };
; CHECK: Reduction like: 0
; CHECK: MustWriteAccess :=
; CHECK: [N] -> { Stmt_bb[i0] -> MemRef_a[i0] };