1 ; RUN: opt %loadPolly -analyze -polly-scops < %s | FileCheck %s -check-prefix=SCOP
2 ; RUN: opt %loadPolly -S -polly-codegen-ppcg < %s | FileCheck %s -check-prefix=HOST-IR
7 ; SCOP-NEXT: Region: %for.body---%for.end
8 ; SCOP-NEXT: Max Loop Depth: 1
10 ; Check that kernel launch is generated in host IR.
11 ; the declare would not be generated unless a call to a kernel exists.
12 ; HOST-IR: declare void @polly_launchKernel(i8*, i32, i32, i32, i32, i32, i8*)
14 ; void f(int A[], int B[], int control, int C[]) {
17 ; for(int i = 0; i < 1000; i ++) {
19 ; if(control) x = C[i];
26 target datalayout = "e-m:o-i64:64-f80:128-n8:16:32:64-S128"
28 define void @f(i32* %A, i32* %B, i32 %control, i32* %C) {
32 entry.split: ; preds = %entry
35 for.body: ; preds = %entry.split, %if.end
36 %indvars.iv = phi i64 [ 0, %entry.split ], [ %indvars.iv.next, %if.end ]
37 %tobool = icmp eq i32 %control, 0
38 br i1 %tobool, label %if.end, label %if.then
40 if.then: ; preds = %for.body
41 %arrayidx = getelementptr inbounds i32, i32* %C, i64 %indvars.iv
42 %tmp4 = load i32, i32* %arrayidx, align 4
45 if.end: ; preds = %for.body, %if.then
46 %x.0 = phi i32 [ %tmp4, %if.then ], [ 0, %for.body ]
47 %arrayidx2 = getelementptr inbounds i32, i32* %A, i64 %indvars.iv
48 %tmp8 = load i32, i32* %arrayidx2, align 4
49 %mul = mul nsw i32 %tmp8, %x.0
50 %arrayidx4 = getelementptr inbounds i32, i32* %B, i64 %indvars.iv
51 store i32 %mul, i32* %arrayidx4, align 4
52 %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
53 %exitcond = icmp ne i64 %indvars.iv.next, 1000
54 br i1 %exitcond, label %for.body, label %for.end
56 for.end: ; preds = %if.end