llvm-project
44 строки · 1.4 Кб
1; RUN: opt %loadNPMPolly '-passes=print<polly-detect>' -disable-output < %s 2>&1 | FileCheck %s
2;
3; Verify polly skips this function
4;
5; CHECK-NOT: Valid Region for Scop
6;
7; void polly_skip_me(int *A, int N) {
8; for (int i = 0; i < N; i++)
9; A[i] = A[i] * A[i] + A[i];
10; }
11;
12target datalayout = "e-m:e-p:32:32-i64:64-v128:64:128-n32-S64"
13
14define void @polly_skip_me(ptr %A, i32 %N) #0 {
15entry:
16br label %entry.split
17
18entry.split: ; preds = %entry
19%cmp1 = icmp sgt i32 %N, 0
20br i1 %cmp1, label %for.body.preheader, label %for.end
21
22for.body.preheader: ; preds = %entry.split
23br label %for.body
24
25for.body: ; preds = %for.body.preheader, %for.body
26%i.02 = phi i32 [ %inc, %for.body ], [ 0, %for.body.preheader ]
27%arrayidx = getelementptr inbounds i32, ptr %A, i32 %i.02
28%tmp = load i32, ptr %arrayidx, align 4
29%mul = mul nsw i32 %tmp, %tmp
30%add = add nsw i32 %mul, %tmp
31%arrayidx3 = getelementptr inbounds i32, ptr %A, i32 %i.02
32store i32 %add, ptr %arrayidx3, align 4
33%inc = add nsw i32 %i.02, 1
34%cmp = icmp slt i32 %inc, %N
35br i1 %cmp, label %for.body, label %for.end.loopexit
36
37for.end.loopexit: ; preds = %for.body
38br label %for.end
39
40for.end: ; preds = %for.end.loopexit, %entry.split
41ret void
42}
43
44attributes #0 = { "polly.skip.fn" }
45