1; RUN: opt %loadPolly -polly-stmt-granularity=bb -polly-scops -analyze < %s | FileCheck %s 2 3target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128" 4 5; Verify that we can look through a bitcast when delinearizing multi-dimensional 6; arrays. 7 8; CHECK: Stmt_bb7[i0, i1] -> MemRef_B[i0, i1] 9; CHECK: Stmt_bb7[i0, i1] -> MemRef_B[i0, i1] 10; CHECK: Stmt_bb17[i0] -> MemRef_B[i0, 100] 11 12define void @kernel(float* %A, [101 x float]* %B, [101 x float]* %C, float* %D) { 13bb: 14 br label %bb4 15 16bb4: ; preds = %bb21, %bb 17 %indvars.iv1 = phi i64 [ %indvars.iv.next2, %bb21 ], [ 0, %bb ] 18 %exitcond3 = icmp eq i64 %indvars.iv1, 100 19 br i1 %exitcond3, label %bb22, label %bb5 20 21bb5: ; preds = %bb4 22 br label %bb6 23 24bb6: ; preds = %bb16, %bb5 25 %indvars.iv = phi i64 [ %indvars.iv.next, %bb16 ], [ 0, %bb5 ] 26 %exitcond = icmp eq i64 %indvars.iv, 100 27 br i1 %exitcond, label %bb17, label %bb7 28 29bb7: ; preds = %bb6 30 %tmp = getelementptr inbounds float, float* %D, i64 %indvars.iv 31 %tmp8 = load float, float* %tmp, align 4 32 %tmp9 = getelementptr inbounds [101 x float], [101 x float]* %B, i64 %indvars.iv1, i64 %indvars.iv 33 %tmp10 = load float, float* %tmp9, align 4 34 %tmp11 = fmul float %tmp8, %tmp10 35 %tmp12 = getelementptr inbounds [101 x float], [101 x float]* %C, i64 %indvars.iv1, i64 %indvars.iv 36 store float %tmp11, float* %tmp12, align 4 37 %tmp13 = getelementptr inbounds float, float* %A, i64 %indvars.iv 38 %0 = bitcast float* %tmp13 to i32* 39 %tmp141 = load i32, i32* %0, align 4 40 %tmp15 = getelementptr inbounds [101 x float], [101 x float]* %B, i64 %indvars.iv1, i64 %indvars.iv 41 %1 = bitcast float* %tmp15 to i32* 42 store i32 %tmp141, i32* %1, align 4 43 br label %bb16 44 45bb16: ; preds = %bb7 46 %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1 47 br label %bb6 48 49bb17: ; preds = %bb6 50 %tmp18 = trunc i64 %indvars.iv1 to i32 51 %tmp19 = sitofp i32 %tmp18 to float 52 %tmp20 = getelementptr inbounds [101 x float], [101 x float]* %B, i64 %indvars.iv1, i64 100 53 store float %tmp19, float* %tmp20, align 4 54 br label %bb21 55 56bb21: ; preds = %bb17 57 %indvars.iv.next2 = add nuw nsw i64 %indvars.iv1, 1 58 br label %bb4 59 60bb22: ; preds = %bb4 61 ret void 62} 63