1 ; RUN: opt %loadPolly -polly-process-unprofitable -polly-codegen -polly-invariant-load-hoisting=true -polly-ignore-aliasing -S < %s | FileCheck %s
3 ; CHECK-LABEL: polly.preload.begin:
4 ; CHECK: %polly.access.A = getelementptr ptr, ptr %A, i64 42
5 ; CHECK: %polly.access.A.load = load ptr, ptr %polly.access.A
6 ; CHECK: %polly.access.polly.access.A.load = getelementptr ptr, ptr %polly.access.A.load, i64 32
7 ; CHECK: %polly.access.polly.access.A.load.load = load ptr, ptr %polly.access.polly.access.A.load
9 ; CHECK: polly.stmt.bb2:
10 ; CHECK: %[[offset:.*]] = shl nuw nsw i64 %polly.indvar, 2
11 ; CHECK: %scevgep = getelementptr i8, ptr %polly.access.polly.access.A.load.load, i64 %[[offset]]
12 ; CHECK: store i32 0, ptr %scevgep, align 4
15 ; for (int i = 0; i < 1024; i++)
19 target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"
21 define void @f(ptr %A) {
25 bb1: ; preds = %bb7, %bb
26 %indvars.iv = phi i64 [ %indvars.iv.next, %bb7 ], [ 0, %bb ]
27 %exitcond = icmp ne i64 %indvars.iv, 1024
28 br i1 %exitcond, label %bb2, label %bb8
31 %tmp = getelementptr inbounds ptr, ptr %A, i64 42
32 %tmp3 = load ptr, ptr %tmp, align 8
33 %tmp4 = getelementptr inbounds ptr, ptr %tmp3, i64 32
34 %tmp5 = load ptr, ptr %tmp4, align 8
35 %tmp6 = getelementptr inbounds i32, ptr %tmp5, i64 %indvars.iv
36 store i32 0, ptr %tmp6, align 4
40 %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1