1 ; RUN: opt %loadPolly -polly-codegen -S < %s | FileCheck %s
3 ; void jd(int *A, int *B, int c) {
4 ; for (int i = 0; i < 1024; i++)
8 ; CHECK: %[[Cext:[._a-zA-Z0-9]*]] = sext i32 %c to i64
9 ; CHECK: %[[Cp1:[._a-zA-Z0-9]*]] = call { i64, i1 } @llvm.sadd.with.overflow.i64(i64 %[[Cext]], i64 1)
10 ; CHECK: %[[Cp1O:[._a-zA-Z0-9]*]] = extractvalue { i64, i1 } %[[Cp1]], 1
11 ; CHECK: %[[OS:[._a-zA-Z0-9]*]] = or i1 false, %[[Cp1O]]
12 ; CHECK: %[[Cp1R:[._a-zA-Z0-9]*]] = extractvalue { i64, i1 } %[[Cp1]], 0
13 ; CHECK: %[[BMax:[._a-zA-Z0-9]*]] = getelementptr i32, ptr %B, i64 %[[Cp1R]]
14 ; CHECK: %[[AMin:[._a-zA-Z0-9]*]] = getelementptr i32, ptr %A, i64 0
15 ; CHECK: %[[BMaxI:[._a-zA-Z0-9]*]] = ptrtoint ptr %[[BMax]] to i64
16 ; CHECK: %[[AMinI:[._a-zA-Z0-9]*]] = ptrtoint ptr %[[AMin]] to i64
17 ; CHECK: %[[BltA:[._a-zA-Z0-9]*]] = icmp ule i64 %[[BMaxI]], %[[AMinI]]
18 ; CHECK: %[[AMax:[._a-zA-Z0-9]*]] = getelementptr i32, ptr %A, i64 1024
19 ; CHECK: %[[BMin:[._a-zA-Z0-9]*]] = getelementptr i32, ptr %B, i32 %c
20 ; CHECK: %[[AMaxI:[._a-zA-Z0-9]*]] = ptrtoint ptr %[[AMax]] to i64
21 ; CHECK: %[[BMinI:[._a-zA-Z0-9]*]] = ptrtoint ptr %[[BMin]] to i64
22 ; CHECK: %[[AltB:[._a-zA-Z0-9]*]] = icmp ule i64 %[[AMaxI]], %[[BMinI]]
23 ; CHECK: %[[NoAlias:[._a-zA-Z0-9]*]] = or i1 %[[BltA]], %[[AltB]]
24 ; CHECK: %[[RTC:[._a-zA-Z0-9]*]] = and i1 true, %[[NoAlias]]
25 ; CHECK: %[[NOV:[._a-zA-Z0-9]*]] = xor i1 %[[OS]], true
26 ; CHECK: %[[RTCV:[._a-zA-Z0-9]*]] = and i1 %[[RTC]], %[[NOV]]
27 ; CHECK: br i1 %[[RTCV]], label %polly.start, label %for.cond
29 target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"
31 define void @jd(ptr %A, ptr %B, i32 %c) {
35 for.cond: ; preds = %for.inc, %entry
36 %indvars.iv = phi i64 [ %indvars.iv.next, %for.inc ], [ 0, %entry ]
37 %exitcond = icmp ne i64 %indvars.iv, 1024
38 br i1 %exitcond, label %for.body, label %for.end
40 for.body: ; preds = %for.cond
41 %idxprom = sext i32 %c to i64
42 %arrayidx = getelementptr inbounds i32, ptr %B, i64 %idxprom
43 %tmp = load i32, ptr %arrayidx, align 4
44 %arrayidx2 = getelementptr inbounds i32, ptr %A, i64 %indvars.iv
45 store i32 %tmp, ptr %arrayidx2, align 4
48 for.inc: ; preds = %for.body
49 %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
52 for.end: ; preds = %for.cond