1 ; RUN: opt %loadPolly -polly-codegen -polly-invariant-load-hoisting=true -S < %s | FileCheck %s
3 ; CHECK-LABEL: polly.preload.begin:
4 ; CHECK-NEXT: %polly.access.B = getelementptr i32, ptr %B, i64 0
5 ; CHECK-NEXT: %polly.access.B.load = load i32, ptr %polly.access.B
7 ; CHECK-LABEL: polly.stmt.bb2:
8 ; CHECK-NEXT: %[[offset:.*]] = shl nuw nsw i64 %polly.indvar, 2
9 ; CHECK-NEXT: %scevgep = getelementptr i8, ptr %A, i64 %[[offset]]
10 ; CHECK-NEXT: store i32 %polly.access.B.load, ptr %scevgep, align 4
12 ; void f(int *restrict A, int *restrict B) {
13 ; for (int i = 0; i < 1024; i++)
17 target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"
19 define void @f(ptr noalias %A, ptr noalias %B) {
23 bb1: ; preds = %bb4, %bb
24 %indvars.iv = phi i64 [ %indvars.iv.next, %bb4 ], [ 0, %bb ]
25 %exitcond = icmp ne i64 %indvars.iv, 1024
26 br i1 %exitcond, label %bb2, label %bb5
29 %tmp = load i32, ptr %B, align 4
30 %tmp3 = getelementptr inbounds i32, ptr %A, i64 %indvars.iv
31 store i32 %tmp, ptr %tmp3, align 4
35 %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1