1 ; RUN: opt %loadNPMPolly -passes=polly-codegen -polly-invariant-load-hoisting=true -polly-process-unprofitable -S < %s | FileCheck %s
5 ; void f(int *A, int *B) {
12 ; } while (i++ < 100);
18 ; } while (i++ < x / 2);
21 ; CHECK: polly.stmt.stmt.P:
22 ; CHECK: sext i32 %tmp.merge to i64
24 target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"
26 define void @f(ptr %A, ptr %B) {
30 stmt.S: ; preds = %do.cond, %entry
31 %indvars.iv2 = phi i64 [ %indvars.iv.next3, %do.cond ], [ 0, %entry ]
32 %tmp = load i32, ptr %B, align 4
33 %arrayidx = getelementptr inbounds i32, ptr %A, i64 %indvars.iv2
34 %tmp4 = load i32, ptr %arrayidx, align 4
35 %add = add nsw i32 %tmp4, %tmp
36 store i32 %add, ptr %arrayidx, align 4
39 do.cond: ; preds = %do.body
40 %indvars.iv.next3 = add nuw nsw i64 %indvars.iv2, 1
41 %exitcond = icmp ne i64 %indvars.iv.next3, 101
42 br i1 %exitcond, label %stmt.S, label %do.end
44 do.end: ; preds = %do.cond
45 %tmp5 = trunc i64 101 to i32
47 %tmp6 = sext i32 %tmp5 to i64
50 stmt.P: ; preds = %do.cond.5, %do.end
51 %indvars.iv = phi i64 [ %indvars.iv.next, %do.cond.5 ], [ %tmp6, %do.end ]
52 %arrayidx3 = getelementptr inbounds i32, ptr %A, i64 %indvars.iv
53 %tmp7 = load i32, ptr %arrayidx3, align 4
54 %inc4 = add nsw i32 %tmp7, 1
55 store i32 %inc4, ptr %arrayidx3, align 4
58 do.cond.5: ; preds = %do.body.1
59 %div = sdiv i32 %tmp, 2
60 %tmp8 = sext i32 %div to i64
61 %cmp7 = icmp slt i64 %indvars.iv, %tmp8
62 %indvars.iv.next = add i64 %indvars.iv, 1
63 br i1 %cmp7, label %stmt.P, label %do.end.8
65 do.end.8: ; preds = %do.cond.5