llvm-project
45 строк · 1.7 Кб
1; RUN: opt %loadNPMPolly -polly-process-unprofitable '-passes=print<polly-function-scops>,scop(print<polly-ast>)' -disable-output -S < %s | FileCheck %s --check-prefix=AST
2; RUN: opt %loadNPMPolly -polly-process-unprofitable '-passes=print<polly-function-scops>,scop(polly-codegen)' -S < %s | FileCheck %s --check-prefix=CODEGEN
3
4target datalayout = "e-m:e-i64:64-i128:128-n8:16:32:64-S128"
5target triple = "aarch64--linux-gnu"
6
7; This test is to ensure that for we generate signed remainder for
8; the polly.cond check.
9
10; AST: isl ast :: foo1
11; AST: if ((a1 - b1) % 24 == 0)
12
13; CODEGEN: define void @foo1
14; CODEGEN: polly.cond:
15; CODEGEN: %pexp.zdiv_r = srem {{.*}}, 24
16
17%struct.A = type { i32, i64, i8 }
18
19; Function Attrs: norecurse nounwind
20define void @foo1(ptr %a1, ptr readnone %b1) #0 {
21entry:
22br label %entry.split
23
24entry.split: ; preds = %entry
25%cmp4 = icmp eq ptr %a1, %b1
26br i1 %cmp4, label %for.cond.cleanup, label %for.body.preheader
27
28for.body.preheader: ; preds = %entry.split
29br label %for.body
30
31for.cond.cleanup.loopexit: ; preds = %for.body
32br label %for.cond.cleanup
33
34for.cond.cleanup: ; preds = %for.cond.cleanup.loopexit, %entry.split
35ret void
36
37for.body: ; preds = %for.body.preheader, %for.body
38%start.05 = phi ptr [ %incdec.ptr, %for.body ], [ %a1, %for.body.preheader ]
39%0 = load i32, ptr %start.05, align 8
40%add = add nsw i32 %0, 1
41store i32 %add, ptr %start.05, align 8
42%incdec.ptr = getelementptr inbounds %struct.A, ptr %start.05, i64 1
43%cmp = icmp eq ptr %incdec.ptr, %b1
44br i1 %cmp, label %for.cond.cleanup.loopexit, label %for.body
45}
46
47
48