86 lines · plain
1; Test if "polly-debug" flag enables debug prints from different parts of polly2; RUN: opt %loadNPMPolly -O3 -polly -polly-debug --disable-output < %s 2>&1 | FileCheck %s3;4; REQUIRES: asserts5 6; void callee(int n, double A[], int i) {7; for (int j = 0; j < n; j += 1)8; A[i+j] = 42.0;9; }10;11; void caller(int n, double A[]) {12; for (int i = 0; i < n; i += 1)13; callee(n, A, i);14; }15 16 17%unrelated_type = type { i32 }18 19define internal void @callee(i32 %n, ptr noalias nonnull %A, i32 %i) #0 {20entry:21 br label %for22 23for:24 %j = phi i32 [0, %entry], [%j.inc, %inc]25 %j.cmp = icmp slt i32 %j, %n26 br i1 %j.cmp, label %body, label %exit27 28 body:29 %idx = add i32 %i, %j30 %arrayidx = getelementptr inbounds double, ptr %A, i32 %idx31 store double 42.0, ptr %arrayidx32 br label %inc33 34inc:35 %j.inc = add nuw nsw i32 %j, 136 br label %for37 38exit:39 br label %return40 41return:42 ret void43}44 45 46define void @caller(i32 %n, ptr noalias nonnull %A) #0 {47entry:48 br label %for49 50for:51 %i = phi i32 [0, %entry], [%j.inc, %inc]52 %i.cmp = icmp slt i32 %i, %n53 br i1 %i.cmp, label %body, label %exit54 55 body:56 call void @callee(i32 %n, ptr %A, i32 %i)57 br label %inc58 59inc:60 %j.inc = add nuw nsw i32 %i, 161 br label %for62 63exit:64 br label %return65 66return:67 ret void68}69 70 71declare void @unrelated_decl()72 73 74attributes #0 = { noinline }75 76!llvm.ident = !{!8}77!8 = !{!"xyxxy"}78 79; CHECK: Checking region: entry => <Function Return>80; CHECK: Removing statements that are never executed...81; CHECK: Final Scop:82; CHECK: Forwarding operand trees...83; CHECK: Final Scop:84; CHECK: Collapsing scalars to unused array elements...85; CHECK: Final Scop:86