brintos

brintos / llvm-project-archived public Read only

0
0
Text · 2.0 KiB · 1ddfb58 Raw
83 lines · plain
1; RUN: opt %loadNPMPolly -O3 -polly -polly-position=early                    -disable-output -polly-print-scops < %s 2>&1 | FileCheck %s --check-prefix=NOINLINE2; RUN: opt %loadNPMPolly -O3 -polly -polly-position=early -polly-run-inliner -disable-output -polly-print-scops < %s 2>&1 | FileCheck %s --check-prefix=INLINED13; RUN: opt %loadNPMPolly -O3 -polly -polly-position=before-vectorizer        -disable-output -polly-print-scops < %s 2>&1 | FileCheck %s --check-prefix=INLINED34;5; void callee(int n, double A[], int i) {6;   for (int j = 0; j < n; j += 1)7;     A[i+j] = 42.0;8; }9;10; void caller(int n, double A[]) {11;   for (int i = 0; i < n; i += 1)12;     callee(n, A, i);13; }14 15 16define internal void @callee(i32 %n, ptr noalias nonnull %A, i32 %i) {17entry:18  br label %for19 20for:21  %j = phi i32 [0, %entry], [%j.inc, %inc]22  %j.cmp = icmp slt i32 %j, %n23  br i1 %j.cmp, label %body, label %exit24 25    body:26      %idx = add i32 %i, %j27      %arrayidx = getelementptr inbounds double, ptr %A, i32 %idx28      store double 42.0, ptr %arrayidx29      br label %inc30 31inc:32  %j.inc = add nuw nsw i32 %j, 133  br label %for34 35exit:36  br label %return37 38return:39  ret void40}41 42 43define void @caller(i32 %n, ptr noalias nonnull %A) {44entry:45  br label %for46 47for:48  %i = phi i32 [0, %entry], [%j.inc, %inc]49  %i.cmp = icmp slt i32 %i, %n50  br i1 %i.cmp, label %body, label %exit51 52    body:53      call void @callee(i32 %n, ptr %A, i32 %i)54      br label %inc55 56inc:57  %j.inc = add nuw nsw i32 %i, 158  br label %for59 60exit:61  br label %return62 63return:64  ret void65}66 67 68; NOINLINE-LABEL: Function: callee69; NOINLINE:       Schedule :=70; NOINLINE-NEXT:    [n, i] -> { Stmt_body[i0] -> [i0] };71 72; INLINED1-LABEL: Function: caller73; INLINED1:       Schedule :=74; INLINED1-NEXT:    [n] -> { Stmt_body_i[i0, i1] -> [i0, i1] };75 76; INLINED2-LABEL: Function: caller77; INLINED2:       Schedule :=78; INLINED2-NEXT:    [n] -> { Stmt_polly_loop_header_i_us_us[i0, i1] -> [i0, 1, i1] };79 80; INLINED3-LABEL: Function: caller81; INLINED3:       Schedule :=82; INLINED3-NEXT:    [n] -> { Stmt_body_i_us[i0, i1] -> [i0, i1] };83