1; RUN: opt %loadPolly -tbaa -polly-scops -polly-invariant-load-hoisting=true -polly-ignore-aliasing \ 2; RUN: -analyze < %s | FileCheck %s 3; 4; Note: The order of the invariant accesses is important because A is the 5; base pointer of tmp3 and we will generate code in the same order as 6; the invariant accesses are listed here. 7; 8; CHECK: Invariant Accesses: { 9; CHECK: ReadAccess := [Reduction Type: NONE] [Scalar: 0] 10; CHECK: MemRef_A[42] 11; CHECK: ReadAccess := [Reduction Type: NONE] [Scalar: 0] 12; CHECK: MemRef_tmp3[32] 13; CHECK: } 14; 15; CHECK: Arrays { 16; CHECK: i32** MemRef_A[*]; 17; CHECK: i32* MemRef_tmp3[*]; [BasePtrOrigin: MemRef_A] 18; CHECK: i32 MemRef_tmp5[*]; [BasePtrOrigin: MemRef_tmp3] 19; CHECK: } 20; 21; CHECK: Arrays (Bounds as pw_affs) { 22; CHECK: i32** MemRef_A[*]; 23; CHECK: i32* MemRef_tmp3[*]; [BasePtrOrigin: MemRef_A] 24; CHECK: i32 MemRef_tmp5[*]; [BasePtrOrigin: MemRef_tmp3] 25; CHECK: } 26; 27; void f(int ***A) { 28; for (int i = 0; i < 1024; i++) 29; A[42][32][i] = 0; 30; } 31; 32target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128" 33 34define void @f(i32*** %A) { 35bb: 36 br label %bb1 37 38bb1: ; preds = %bb7, %bb 39 %indvars.iv = phi i64 [ %indvars.iv.next, %bb7 ], [ 0, %bb ] 40 %exitcond = icmp ne i64 %indvars.iv, 1024 41 br i1 %exitcond, label %bb2, label %bb8 42 43bb2: ; preds = %bb1 44 %tmp = getelementptr inbounds i32**, i32*** %A, i64 42 45 %tmp3 = load i32**, i32*** %tmp, align 8 46 %tmp4 = getelementptr inbounds i32*, i32** %tmp3, i64 32 47 %tmp5 = load i32*, i32** %tmp4, align 8 48 %tmp6 = getelementptr inbounds i32, i32* %tmp5, i64 %indvars.iv 49 store i32 0, i32* %tmp6, align 4 50 br label %bb7 51 52bb7: ; preds = %bb2 53 %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1 54 br label %bb1 55 56bb8: ; preds = %bb1 57 ret void 58} 59