2015-10-06 23:36:44 +08:00
|
|
|
; RUN: opt %loadPolly -polly-codegen -polly-parallel -S < %s | FileCheck %s --check-prefix=AUTO
|
|
|
|
; RUN: opt %loadPolly -polly-codegen -polly-parallel -polly-num-threads=1 -S < %s | FileCheck %s --check-prefix=ONE
|
|
|
|
; RUN: opt %loadPolly -polly-codegen -polly-parallel -polly-num-threads=4 -S < %s | FileCheck %s --check-prefix=FOUR
|
2014-10-04 03:11:10 +08:00
|
|
|
;
|
2015-09-08 14:22:17 +08:00
|
|
|
; AUTO: call void @GOMP_parallel_loop_runtime_start(void (i8*)* @jd_polly_subfn, i8* %polly.par.userContext{{[0-9]*}}, i32 0, i64 0, i64 1024, i64 1)
|
|
|
|
; ONE: call void @GOMP_parallel_loop_runtime_start(void (i8*)* @jd_polly_subfn, i8* %polly.par.userContext{{[0-9]*}}, i32 1, i64 0, i64 1024, i64 1)
|
|
|
|
; FOUR: call void @GOMP_parallel_loop_runtime_start(void (i8*)* @jd_polly_subfn, i8* %polly.par.userContext{{[0-9]*}}, i32 4, i64 0, i64 1024, i64 1)
|
2014-10-04 03:11:10 +08:00
|
|
|
;
|
|
|
|
; void jd(int *A) {
|
|
|
|
; for (int i = 0; i < 1024; i++)
|
2014-12-03 03:26:58 +08:00
|
|
|
; for (int j = 0; j < 1024; j++)
|
|
|
|
; A[i + j * 1024] = 0;
|
2014-10-04 03:11:10 +08:00
|
|
|
; }
|
|
|
|
;
|
|
|
|
target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"
|
|
|
|
|
|
|
|
define void @jd(i32* %A) {
|
|
|
|
entry:
|
|
|
|
br label %for.cond
|
|
|
|
|
2014-12-03 03:26:58 +08:00
|
|
|
for.cond: ; preds = %for.inc4, %entry
|
|
|
|
%indvars.iv3 = phi i64 [ %indvars.iv.next4, %for.inc4 ], [ 0, %entry ]
|
|
|
|
%exitcond5 = icmp ne i64 %indvars.iv3, 1024
|
|
|
|
br i1 %exitcond5, label %for.body, label %for.end6
|
2014-10-04 03:11:10 +08:00
|
|
|
|
|
|
|
for.body: ; preds = %for.cond
|
2014-12-03 03:26:58 +08:00
|
|
|
br label %for.cond1
|
|
|
|
|
|
|
|
for.cond1: ; preds = %for.inc, %for.body
|
|
|
|
%indvars.iv = phi i64 [ %indvars.iv.next, %for.inc ], [ 0, %for.body ]
|
|
|
|
%exitcond = icmp ne i64 %indvars.iv, 1024
|
|
|
|
br i1 %exitcond, label %for.body3, label %for.end
|
|
|
|
|
|
|
|
for.body3: ; preds = %for.cond1
|
|
|
|
%tmp = shl nsw i64 %indvars.iv, 10
|
|
|
|
%tmp6 = add nsw i64 %indvars.iv3, %tmp
|
2015-02-28 03:20:19 +08:00
|
|
|
%arrayidx = getelementptr inbounds i32, i32* %A, i64 %tmp6
|
2014-10-04 03:11:10 +08:00
|
|
|
store i32 0, i32* %arrayidx, align 4
|
|
|
|
br label %for.inc
|
|
|
|
|
2014-12-03 03:26:58 +08:00
|
|
|
for.inc: ; preds = %for.body3
|
2014-10-04 03:11:10 +08:00
|
|
|
%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
|
2014-12-03 03:26:58 +08:00
|
|
|
br label %for.cond1
|
|
|
|
|
|
|
|
for.end: ; preds = %for.cond1
|
|
|
|
br label %for.inc4
|
|
|
|
|
|
|
|
for.inc4: ; preds = %for.end
|
|
|
|
%indvars.iv.next4 = add nuw nsw i64 %indvars.iv3, 1
|
2014-10-04 03:11:10 +08:00
|
|
|
br label %for.cond
|
|
|
|
|
2014-12-03 03:26:58 +08:00
|
|
|
for.end6: ; preds = %for.cond
|
2014-10-04 03:11:10 +08:00
|
|
|
ret void
|
|
|
|
}
|