1 ; RUN: opt %loadPolly -polly-codegen -polly-invariant-load-hoisting=true -polly-ignore-aliasing -polly-process-unprofitable -S < %s | FileCheck %s
3 ; CHECK-LABEL: polly.preload.begin:
4 ; CHECK-NEXT: %0 = sext i32 %N to i64
5 ; CHECK-NEXT: %1 = icmp sge i64 %0, 514
6 ; CHECK-NEXT: %polly.preload.cond.result = and i1 %1, true
7 ; CHECK-NEXT: br label %polly.preload.cond
9 ; CHECK-LABEL: polly.preload.cond:
10 ; CHECK-NEXT: br i1 %polly.preload.cond.result, label %polly.preload.exec, label %polly.preload.merge
12 ; CHECK-LABEL: polly.preload.merge:
13 ; CHECK-NEXT: %polly.preload.tmp6.merge = phi ptr [ %polly.access.BPLoc.load, %polly.preload.exec ], [ null, %polly.preload.cond ]
15 ; CHECK-LABEL: polly.stmt.bb5:
16 ; CHECK-NEXT: %[[offset:.*]] = shl nuw nsw i64 %polly.indvar6, 2
17 ; CHECK-NEXT: %{{.*}} = getelementptr i8, ptr %polly.preload.tmp6.merge, i64 %[[offset]]
19 ; void f(int **BPLoc, int *A, int N) {
20 ; for (int i = 0; i < N; i++)
27 target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"
29 define void @f(ptr %BPLoc, ptr %A, i32 %N) {
31 %tmp = sext i32 %N to i64
34 bb1: ; preds = %bb11, %bb
35 %indvars.iv = phi i64 [ %indvars.iv.next, %bb11 ], [ 0, %bb ]
36 %tmp2 = icmp slt i64 %indvars.iv, %tmp
37 br i1 %tmp2, label %bb3, label %bb12
40 %tmp4 = icmp sgt i64 %indvars.iv, 512
41 br i1 %tmp4, label %bb5, label %bb8
44 %tmp6 = load ptr, ptr %BPLoc, align 8
45 %tmp7 = getelementptr inbounds i32, ptr %tmp6, i64 %indvars.iv
46 store i32 0, ptr %tmp7, align 4
50 %tmp9 = getelementptr inbounds i32, ptr %A, i64 %indvars.iv
51 store i32 0, ptr %tmp9, align 4
54 bb10: ; preds = %bb8, %bb5
58 %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1