1; RUN: opt %loadPolly -polly-scops -analyze \ 2; RUN: -polly-precise-fold-accesses \ 3; RUN: -polly-invariant-load-hoisting=true < %s | FileCheck %s 4 5; subroutine init_array(ni, nj, pi, pj, a) 6; implicit none 7 8; double precision, dimension(nj, ni) :: a 9; integer*8 :: ni, nj 10; integer*8 :: pi, pj 11; integer*8 :: i, j 12 13; do i = 1, ni 14; do j = 1, nj 15; a(j + pi, i + pj) = i + j 16; end do 17; end do 18; end subroutine 19 20; CHECK: [tmp9, nj_loaded2, tmp20, tmp19] -> { Stmt_bb17[i0, i1] -> MemRef_a[-1 + tmp20 + i0, nj_loaded2 + tmp19 + i1] : i1 < -tmp19; Stmt_bb17[i0, i1] -> MemRef_a[tmp20 + i0, tmp19 + i1] : i1 >= -tmp19 }; 21 22 23target datalayout = "e-p:64:64:64-S128-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f16:16:16-f32:32:32-f64:64:64-f128:128:128-v64:64:64-v128:128:128-a0:0:64-s0:64:64-f80:128:128-n8:16:32:64" 24target triple = "x86_64-unknown-linux-gnu" 25 26module asm "\09.ident\09\22GCC: (GNU) 4.6.4 LLVM: 3.3.1\22" 27 28; Function Attrs: nounwind uwtable 29define void @blam(i64* noalias %arg, i64* noalias %nj, i64* noalias %arg2, i64* noalias %arg3, [0 x double]* noalias %a) unnamed_addr #0 { 30bb: 31 br label %bb5 32 33bb5: ; preds = %bb 34 %nj_loaded = load i64, i64* %nj, align 8 35 %tmp6 = icmp slt i64 %nj_loaded, 0 36 %tmp7 = select i1 %tmp6, i64 0, i64 %nj_loaded 37 %tmp8 = xor i64 %tmp7, -1 38 %tmp9 = load i64, i64* %arg, align 8 39 %tmp10 = icmp sgt i64 %tmp9, 0 40 br i1 %tmp10, label %bb11, label %bb36 41 42bb11: ; preds = %bb5 43 br label %bb12 44 45bb12: ; preds = %bb32, %bb11 46 %tmp13 = phi i64 [ %tmp34, %bb32 ], [ 1, %bb11 ] 47 %nj_loaded2 = load i64, i64* %nj, align 8 48 %tmp15 = icmp sgt i64 %nj_loaded2, 0 49 br i1 %tmp15, label %bb16, label %bb32 50 51bb16: ; preds = %bb12 52 br label %bb17 53 54bb17: ; preds = %bb17, %bb16 55 %tmp18 = phi i64 [ %tmp30, %bb17 ], [ 1, %bb16 ] 56 %tmp19 = load i64, i64* %arg2, align 8 57 %tmp20 = load i64, i64* %arg3, align 8 58 %tmp21 = add i64 %tmp20, %tmp13 59 %tmp22 = mul i64 %tmp21, %tmp7 60 %tmp23 = add i64 %tmp18, %tmp8 61 %tmp24 = add i64 %tmp23, %tmp19 62 %tmp25 = add i64 %tmp24, %tmp22 63 %tmp26 = add i64 %tmp18, %tmp13 64 %tmp27 = sitofp i64 %tmp26 to double 65 %tmp28 = getelementptr [0 x double], [0 x double]* %a, i64 0, i64 %tmp25 66 store double %tmp27, double* %tmp28, align 8 67 %tmp29 = icmp eq i64 %tmp18, %nj_loaded2 68 %tmp30 = add i64 %tmp18, 1 69 br i1 %tmp29, label %bb31, label %bb17 70 71bb31: ; preds = %bb17 72 br label %bb32 73 74bb32: ; preds = %bb31, %bb12 75 %tmp33 = icmp eq i64 %tmp13, %tmp9 76 %tmp34 = add i64 %tmp13, 1 77 br i1 %tmp33, label %bb35, label %bb12 78 79bb35: ; preds = %bb32 80 br label %bb36 81 82bb36: ; preds = %bb35, %bb5 83 ret void 84} 85 86attributes #0 = { nounwind uwtable } 87