1 ; RUN: opt %loadNPMPolly -polly-process-unprofitable -passes=polly-codegen -polly-invariant-load-hoisting=true -S < %s | FileCheck %s
3 ; CHECK-LABEL: polly.preload.begin:
4 ; CHECK-NEXT: %polly.access.C = getelementptr i32, ptr %C, i64 0
5 ; CHECK-NEXT: %polly.access.C.load = load i32, ptr %polly.access.C
6 ; CHECK-NOT: %polly.access.C.load = load i32, ptr %polly.access.C
8 ; CHECK-LABEL: polly.cond:
9 ; CHECK-NEXT: %[[R0:[0-9]*]] = sext i32 %polly.access.C.load to i64
10 ; CHECK-NEXT: %[[R1:[0-9]*]] = icmp sle i64 %[[R0]], -1
11 ; CHECK-NEXT: %[[R2:[0-9]*]] = sext i32 %polly.access.C.load to i64
12 ; CHECK-NEXT: %[[R3:[0-9]*]] = icmp sge i64 %[[R2]], 1
13 ; CHECK-NEXT: %[[R4:[0-9]*]] = or i1 %[[R1]], %[[R3]]
14 ; CHECK-NEXT: br i1 %[[R4]]
16 ; CHECK-NOT: polly.stmt.bb2
18 ; void f(int *A, int *C) {
19 ; for (int i = 0; i < 1024; i++)
24 target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"
26 define void @f(ptr %A, ptr %C) {
30 bb1: ; preds = %bb7, %bb
31 %indvars.iv = phi i64 [ %indvars.iv.next, %bb7 ], [ 0, %bb ]
32 %exitcond = icmp ne i64 %indvars.iv, 1024
33 br i1 %exitcond, label %bb2, label %bb8
36 %tmp = load i32, ptr %C, align 4
37 %tmp3 = icmp eq i32 %tmp, 0
38 br i1 %tmp3, label %bb6, label %bb4
41 %tmp5 = getelementptr inbounds i32, ptr %A, i64 %indvars.iv
42 store i32 0, ptr %tmp5, align 4
45 bb6: ; preds = %bb2, %bb4
49 %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1