62 lines · plain
1; RUN: opt %loadNPMPolly -polly-detect-full-functions '-passes=cgscc(polly-inline),polly-custom<print-scops>' -disable-output < %s | FileCheck %s2 3; Check that we get the 2 nested loops by inlining `to_be_inlined` into4; `inline_site`.5; CHECK: Max Loop Depth: 26 7; static const int N = 1000;8;9; void to_be_inlined(int A[]) {10; for(int i = 0; i < N; i++)11; A[i] *= 10;12; }13;14; void inline_site(int A[]) {15; for(int i = 0; i < N; i++)16; to_be_inlined(A);17; }18 19target datalayout = "e-m:o-i64:64-f80:128-n8:16:32:64-S128"20target triple = "x86_64-apple-macosx10.12.0"21 22 23define void @to_be_inlined(ptr %A) {24entry:25 br label %entry.split26 27entry.split: ; preds = %entry28 br label %for.body29 30for.body: ; preds = %entry.split, %for.body31 %indvars.iv1 = phi i64 [ 0, %entry.split ], [ %indvars.iv.next, %for.body ]32 %arrayidx = getelementptr inbounds i32, ptr %A, i64 %indvars.iv133 %tmp = load i32, ptr %arrayidx, align 434 %mul = mul nsw i32 %tmp, 1035 store i32 %mul, ptr %arrayidx, align 436 %indvars.iv.next = add nuw nsw i64 %indvars.iv1, 137 %exitcond = icmp eq i64 %indvars.iv.next, 100038 br i1 %exitcond, label %for.end, label %for.body39 40for.end: ; preds = %for.body41 ret void42}43 44define void @inline_site(ptr %A) {45entry:46 br label %entry.split47 48entry.split: ; preds = %entry49 br label %for.body50 51for.body: ; preds = %entry.split, %for.body52 %i.01 = phi i32 [ 0, %entry.split ], [ %inc, %for.body ]53 tail call void @to_be_inlined(ptr %A)54 %inc = add nuw nsw i32 %i.01, 155 %exitcond = icmp eq i32 %inc, 100056 br i1 %exitcond, label %for.end, label %for.body57 58for.end: ; preds = %for.body59 ret void60}61 62