1 ; RUN: opt %loadPolly -polly-process-unprofitable -polly-scops -polly-print-ast -disable-output -S < %s | FileCheck %s --check-prefix=AST
2 ; RUN: opt %loadPolly -polly-process-unprofitable -polly-scops -polly-codegen -S < %s | FileCheck %s --check-prefix=CODEGEN
4 target datalayout = "e-m:e-i64:64-i128:128-n8:16:32:64-S128"
5 target triple = "aarch64--linux-gnu"
7 ; This test is to ensure that for we generate signed remainder for
8 ; the polly.cond check.
10 ; AST: isl ast :: foo1
11 ; AST: if ((a1 - b1) % 24 == 0)
13 ; CODEGEN: define void @foo1
14 ; CODEGEN: polly.cond:
15 ; CODEGEN: %pexp.zdiv_r = srem {{.*}}, 24
17 %struct.A = type { i32, i64, i8 }
19 ; Function Attrs: norecurse nounwind
20 define void @foo1(ptr %a1, ptr readnone %b1) #0 {
24 entry.split: ; preds = %entry
25 %cmp4 = icmp eq ptr %a1, %b1
26 br i1 %cmp4, label %for.cond.cleanup, label %for.body.preheader
28 for.body.preheader: ; preds = %entry.split
31 for.cond.cleanup.loopexit: ; preds = %for.body
32 br label %for.cond.cleanup
34 for.cond.cleanup: ; preds = %for.cond.cleanup.loopexit, %entry.split
37 for.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
41 store 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
44 br i1 %cmp, label %for.cond.cleanup.loopexit, label %for.body