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 addrspace(1) %B, i64 0
5 ; CHECK-NOT: addrspacecast
6 ; CHECK-NEXT: %polly.access.B.load = load i32, ptr addrspace(1) %polly.access.B
8 ; CHECK-LABEL: polly.stmt.bb2:
9 ; CHECK-NEXT: %[[offset:.*]] = shl nuw nsw i64 %polly.indvar, 2
10 ; CHECK-NEXT: %scevgep = getelementptr i8, ptr %A, i64 %[[offset]]
11 ; CHECK-NEXT: store i32 %polly.access.B.load, ptr %scevgep, align 4
13 ; void f(int *restrict A, int *restrict B) {
14 ; for (int i = 0; i < 1024; i++)
18 target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"
20 define void @f(ptr noalias %A, ptr addrspace(1) noalias %B) {
24 bb1: ; preds = %bb4, %bb
25 %indvars.iv = phi i64 [ %indvars.iv.next, %bb4 ], [ 0, %bb ]
26 %exitcond = icmp ne i64 %indvars.iv, 1024
27 br i1 %exitcond, label %bb2, label %bb5
30 %tmp = load i32, ptr addrspace(1) %B, align 4
31 %tmp3 = getelementptr inbounds i32, ptr %A, i64 %indvars.iv
32 store i32 %tmp, ptr %tmp3, align 4
36 %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1