brintos

brintos / llvm-project-archived public Read only

0
0
Text · 2.0 KiB · 863212b Raw
95 lines · plain
1; New pass manager2; RUN: opt %loadNPMPolly -O3 -polly -polly-position=before-vectorizer -polly-dump-before --disable-output %s3; RUN: FileCheck --input-file=dumpfunction-callee-before.ll --check-prefix=CHECK --check-prefix=CALLEE %s4; RUN: FileCheck --input-file=dumpfunction-caller-before.ll --check-prefix=CHECK --check-prefix=CALLER %s5;6; RUN: opt %loadNPMPolly -O3 -polly -polly-position=before-vectorizer -polly-dump-after --disable-output %s7; RUN: FileCheck --input-file=dumpfunction-callee-after.ll --check-prefix=CHECK --check-prefix=CALLEE %s8; RUN: FileCheck --input-file=dumpfunction-caller-after.ll --check-prefix=CHECK --check-prefix=CALLER %s9 10; void callee(int n, double A[], int i) {11;   for (int j = 0; j < n; j += 1)12;     A[i+j] = 42.0;13; }14;15; void caller(int n, double A[]) {16;   for (int i = 0; i < n; i += 1)17;     callee(n, A, i);18; }19 20 21%unrelated_type = type { i32 }22 23define internal void @callee(i32 %n, ptr noalias nonnull %A, i32 %i) #0 {24entry:25  br label %for26 27for:28  %j = phi i32 [0, %entry], [%j.inc, %inc]29  %j.cmp = icmp slt i32 %j, %n30  br i1 %j.cmp, label %body, label %exit31 32    body:33      %idx = add i32 %i, %j34      %arrayidx = getelementptr inbounds double, ptr %A, i32 %idx35      store double 42.0, ptr %arrayidx36      br label %inc37 38inc:39  %j.inc = add nuw nsw i32 %j, 140  br label %for41 42exit:43  br label %return44 45return:46  ret void47}48 49 50define void @caller(i32 %n, ptr noalias nonnull %A) #0 {51entry:52  br label %for53 54for:55  %i = phi i32 [0, %entry], [%j.inc, %inc]56  %i.cmp = icmp slt i32 %i, %n57  br i1 %i.cmp, label %body, label %exit58 59    body:60      call void @callee(i32 %n, ptr %A, i32 %i)61      br label %inc62 63inc:64  %j.inc = add nuw nsw i32 %i, 165  br label %for66 67exit:68  br label %return69 70return:71  ret void72}73 74 75declare void @unrelated_decl()76 77 78attributes #0 = { noinline }79 80!llvm.ident = !{!8}81!8 = !{!"xyxxy"}82 83 84; CHECK-NOT: unrelated_type85 86; CALLEE-LABEL: @callee(87; CALLEE-NOT: @caller88; CALLEE-NOT: @unrelated_decl89 90; CALLER-NOT: define {{.*}} @callee(91; CALLER-LABEL: @caller(92 93; CHECK-NOT: @unrelated_decl94; CHECK: xyxxy95