216 lines · plain
1; ModuleID = '<stdin>'2source_filename = "matmul.c"3target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"4target triple = "x86_64-unknown-linux-gnu"5 6%struct._IO_FILE = type { i32, i8*, i8*, i8*, i8*, i8*, i8*, i8*, i8*, i8*, i8*, i8*, %struct._IO_marker*, %struct._IO_FILE*, i32, i32, i64, i16, i8, [1 x i8], i8*, i64, i8*, i8*, i8*, i8*, i64, i32, [20 x i8] }7%struct._IO_marker = type { %struct._IO_marker*, %struct._IO_FILE*, i32 }8 9@A = common dso_local local_unnamed_addr global [1536 x [1536 x float]] zeroinitializer, align 1610@B = common dso_local local_unnamed_addr global [1536 x [1536 x float]] zeroinitializer, align 1611@stdout = external dso_local local_unnamed_addr global %struct._IO_FILE*, align 812@.str = private unnamed_addr constant [5 x i8] c"%lf \00", align 113@C = common dso_local local_unnamed_addr global [1536 x [1536 x float]] zeroinitializer, align 1614 15; Function Attrs: noinline norecurse nounwind uwtable writeonly16define dso_local void @init_array() local_unnamed_addr {17entry:18 br label %polly.loop_header19 20polly.exiting: ; preds = %polly.loop_exit321 ret void22 23polly.loop_header: ; preds = %polly.loop_exit3, %entry24 %polly.indvar = phi i64 [ 0, %entry ], [ %polly.indvar_next, %polly.loop_exit3 ]25 %0 = trunc i64 %polly.indvar to i3226 br label %polly.loop_header127 28polly.loop_exit3: ; preds = %polly.loop_header129 %polly.indvar_next = add nuw nsw i64 %polly.indvar, 130 %exitcond1 = icmp eq i64 %polly.indvar_next, 153631 br i1 %exitcond1, label %polly.exiting, label %polly.loop_header32 33polly.loop_header1: ; preds = %polly.loop_header1, %polly.loop_header34 %polly.indvar4 = phi i64 [ 0, %polly.loop_header ], [ %polly.indvar_next5.1, %polly.loop_header1 ]35 %1 = trunc i64 %polly.indvar4 to i3236 %2 = mul nuw nsw i32 %1, %037 %3 = and i32 %2, 102238 %4 = or i32 %3, 139 %p_conv = sitofp i32 %4 to double40 %p_div = fmul double %p_conv, 5.000000e-0141 %p_conv4 = fptrunc double %p_div to float42 %scevgep7 = getelementptr [1536 x [1536 x float]], [1536 x [1536 x float]]* @A, i64 0, i64 %polly.indvar, i64 %polly.indvar443 store float %p_conv4, float* %scevgep7, align 8, !alias.scope !2, !noalias !444 %scevgep9 = getelementptr [1536 x [1536 x float]], [1536 x [1536 x float]]* @B, i64 0, i64 %polly.indvar, i64 %polly.indvar445 store float %p_conv4, float* %scevgep9, align 8, !alias.scope !5, !noalias !646 %polly.indvar_next5 = or i64 %polly.indvar4, 147 %5 = trunc i64 %polly.indvar_next5 to i3248 %6 = mul nuw nsw i32 %5, %049 %7 = and i32 %6, 102350 %8 = add nuw nsw i32 %7, 151 %p_conv.1 = sitofp i32 %8 to double52 %p_div.1 = fmul double %p_conv.1, 5.000000e-0153 %p_conv4.1 = fptrunc double %p_div.1 to float54 %scevgep7.1 = getelementptr [1536 x [1536 x float]], [1536 x [1536 x float]]* @A, i64 0, i64 %polly.indvar, i64 %polly.indvar_next555 store float %p_conv4.1, float* %scevgep7.1, align 4, !alias.scope !2, !noalias !456 %scevgep9.1 = getelementptr [1536 x [1536 x float]], [1536 x [1536 x float]]* @B, i64 0, i64 %polly.indvar, i64 %polly.indvar_next557 store float %p_conv4.1, float* %scevgep9.1, align 4, !alias.scope !5, !noalias !658 %polly.indvar_next5.1 = add nuw nsw i64 %polly.indvar4, 259 %exitcond.1 = icmp eq i64 %polly.indvar_next5.1, 153660 br i1 %exitcond.1, label %polly.loop_exit3, label %polly.loop_header161}62 63; Function Attrs: noinline nounwind uwtable64define dso_local void @print_array() local_unnamed_addr {65entry:66 br label %for.cond1.preheader67 68for.cond1.preheader: ; preds = %for.end, %entry69 %indvars.iv6 = phi i64 [ 0, %entry ], [ %indvars.iv.next7, %for.end ]70 %0 = load %struct._IO_FILE*, %struct._IO_FILE** @stdout, align 871 br label %for.body372 73for.body3: ; preds = %for.inc, %for.cond1.preheader74 %indvars.iv = phi i64 [ 0, %for.cond1.preheader ], [ %indvars.iv.next, %for.inc ]75 %1 = phi %struct._IO_FILE* [ %0, %for.cond1.preheader ], [ %5, %for.inc ]76 %arrayidx5 = getelementptr inbounds [1536 x [1536 x float]], [1536 x [1536 x float]]* @C, i64 0, i64 %indvars.iv6, i64 %indvars.iv77 %2 = load float, float* %arrayidx5, align 478 %conv = fpext float %2 to double79 %call = tail call i32 (%struct._IO_FILE*, i8*, ...) @fprintf(%struct._IO_FILE* %1, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), double %conv)80 %3 = trunc i64 %indvars.iv to i3281 %rem = urem i32 %3, 8082 %cmp6 = icmp eq i32 %rem, 7983 br i1 %cmp6, label %if.then, label %for.inc84 85if.then: ; preds = %for.body386 %4 = load %struct._IO_FILE*, %struct._IO_FILE** @stdout, align 887 %fputc3 = tail call i32 @fputc(i32 10, %struct._IO_FILE* %4)88 br label %for.inc89 90for.inc: ; preds = %if.then, %for.body391 %indvars.iv.next = add nuw nsw i64 %indvars.iv, 192 %5 = load %struct._IO_FILE*, %struct._IO_FILE** @stdout, align 893 %exitcond = icmp eq i64 %indvars.iv.next, 153694 br i1 %exitcond, label %for.end, label %for.body395 96for.end: ; preds = %for.inc97 %fputc = tail call i32 @fputc(i32 10, %struct._IO_FILE* %5)98 %indvars.iv.next7 = add nuw nsw i64 %indvars.iv6, 199 %exitcond8 = icmp eq i64 %indvars.iv.next7, 1536100 br i1 %exitcond8, label %for.end12, label %for.cond1.preheader101 102for.end12: ; preds = %for.end103 ret void104}105 106; Function Attrs: nounwind107declare dso_local i32 @fprintf(%struct._IO_FILE* nocapture, i8* nocapture readonly, ...) local_unnamed_addr108 109; Function Attrs: noinline norecurse nounwind uwtable110define dso_local i32 @main() local_unnamed_addr {111entry:112 tail call void @init_array()113 call void @llvm.memset.p0i8.i64(i8* align 16 bitcast ([1536 x [1536 x float]]* @C to i8*), i8 0, i64 9437184, i1 false)114 br label %polly.loop_header8115 116polly.exiting: ; preds = %polly.loop_exit16117 ret i32 0118 119polly.loop_header8: ; preds = %polly.loop_exit16, %entry120 %polly.indvar11 = phi i64 [ %polly.indvar_next12, %polly.loop_exit16 ], [ 0, %entry ]121 br label %polly.loop_header14122 123polly.loop_exit16: ; preds = %polly.loop_exit22124 %polly.indvar_next12 = add nuw nsw i64 %polly.indvar11, 1125 %exitcond2 = icmp eq i64 %polly.indvar_next12, 1536126 br i1 %exitcond2, label %polly.exiting, label %polly.loop_header8127 128polly.loop_header14: ; preds = %polly.loop_exit22, %polly.loop_header8129 %polly.indvar17 = phi i64 [ 0, %polly.loop_header8 ], [ %polly.indvar_next18, %polly.loop_exit22 ]130 %scevgep29 = getelementptr [1536 x [1536 x float]], [1536 x [1536 x float]]* @A, i64 0, i64 %polly.indvar11, i64 %polly.indvar17131 %_p_scalar_30 = load float, float* %scevgep29, align 4, !alias.scope !7, !noalias !9132 %broadcast.splatinsert10 = insertelement <4 x float> undef, float %_p_scalar_30, i32 0133 %broadcast.splat11 = shufflevector <4 x float> %broadcast.splatinsert10, <4 x float> undef, <4 x i32> zeroinitializer134 %broadcast.splatinsert12 = insertelement <4 x float> undef, float %_p_scalar_30, i32 0135 %broadcast.splat13 = shufflevector <4 x float> %broadcast.splatinsert12, <4 x float> undef, <4 x i32> zeroinitializer136 br label %vector.body137 138vector.body: ; preds = %vector.body, %polly.loop_header14139 %index = phi i64 [ 0, %polly.loop_header14 ], [ %index.next.1, %vector.body ]140 %0 = getelementptr [1536 x [1536 x float]], [1536 x [1536 x float]]* @C, i64 0, i64 %polly.indvar11, i64 %index141 %1 = bitcast float* %0 to <4 x float>*142 %wide.load = load <4 x float>, <4 x float>* %1, align 16, !alias.scope !10, !noalias !12143 %2 = getelementptr float, float* %0, i64 4144 %3 = bitcast float* %2 to <4 x float>*145 %wide.load7 = load <4 x float>, <4 x float>* %3, align 16, !alias.scope !10, !noalias !12146 %4 = getelementptr [1536 x [1536 x float]], [1536 x [1536 x float]]* @B, i64 0, i64 %polly.indvar17, i64 %index147 %5 = bitcast float* %4 to <4 x float>*148 %wide.load8 = load <4 x float>, <4 x float>* %5, align 16, !alias.scope !11, !noalias !13149 %6 = getelementptr float, float* %4, i64 4150 %7 = bitcast float* %6 to <4 x float>*151 %wide.load9 = load <4 x float>, <4 x float>* %7, align 16, !alias.scope !11, !noalias !13152 %8 = fmul <4 x float> %broadcast.splat11, %wide.load8153 %9 = fmul <4 x float> %broadcast.splat13, %wide.load9154 %10 = fadd <4 x float> %wide.load, %8155 %11 = fadd <4 x float> %wide.load7, %9156 %12 = bitcast float* %0 to <4 x float>*157 store <4 x float> %10, <4 x float>* %12, align 16, !alias.scope !10, !noalias !12158 %13 = bitcast float* %2 to <4 x float>*159 store <4 x float> %11, <4 x float>* %13, align 16, !alias.scope !10, !noalias !12160 %index.next = or i64 %index, 8161 %14 = getelementptr [1536 x [1536 x float]], [1536 x [1536 x float]]* @C, i64 0, i64 %polly.indvar11, i64 %index.next162 %15 = bitcast float* %14 to <4 x float>*163 %wide.load.1 = load <4 x float>, <4 x float>* %15, align 16, !alias.scope !10, !noalias !12164 %16 = getelementptr float, float* %14, i64 4165 %17 = bitcast float* %16 to <4 x float>*166 %wide.load7.1 = load <4 x float>, <4 x float>* %17, align 16, !alias.scope !10, !noalias !12167 %18 = getelementptr [1536 x [1536 x float]], [1536 x [1536 x float]]* @B, i64 0, i64 %polly.indvar17, i64 %index.next168 %19 = bitcast float* %18 to <4 x float>*169 %wide.load8.1 = load <4 x float>, <4 x float>* %19, align 16, !alias.scope !11, !noalias !13170 %20 = getelementptr float, float* %18, i64 4171 %21 = bitcast float* %20 to <4 x float>*172 %wide.load9.1 = load <4 x float>, <4 x float>* %21, align 16, !alias.scope !11, !noalias !13173 %22 = fmul <4 x float> %broadcast.splat11, %wide.load8.1174 %23 = fmul <4 x float> %broadcast.splat13, %wide.load9.1175 %24 = fadd <4 x float> %wide.load.1, %22176 %25 = fadd <4 x float> %wide.load7.1, %23177 %26 = bitcast float* %14 to <4 x float>*178 store <4 x float> %24, <4 x float>* %26, align 16, !alias.scope !10, !noalias !12179 %27 = bitcast float* %16 to <4 x float>*180 store <4 x float> %25, <4 x float>* %27, align 16, !alias.scope !10, !noalias !12181 %index.next.1 = add nuw nsw i64 %index, 16182 %28 = icmp eq i64 %index.next.1, 1536183 br i1 %28, label %polly.loop_exit22, label %vector.body, !llvm.loop !14184 185polly.loop_exit22: ; preds = %vector.body186 %polly.indvar_next18 = add nuw nsw i64 %polly.indvar17, 1187 %exitcond1 = icmp eq i64 %polly.indvar_next18, 1536188 br i1 %exitcond1, label %polly.loop_exit16, label %polly.loop_header14189}190 191; Function Attrs: nounwind192declare i32 @fputc(i32, %struct._IO_FILE* nocapture) local_unnamed_addr193 194; Function Attrs: argmemonly nounwind195declare void @llvm.memset.p0i8.i64(i8* nocapture writeonly, i8, i64, i1)196 197!llvm.module.flags = !{!0}198!llvm.ident = !{!1}199 200!0 = !{i32 1, !"wchar_size", i32 4}201!1 = !{!"clang version 8.0.0 (trunk 342834) (llvm/trunk 342856)"}202!2 = distinct !{!2, !3, !"polly.alias.scope.MemRef_A"}203!3 = distinct !{!3, !"polly.alias.scope.domain"}204!4 = !{!5}205!5 = distinct !{!5, !3, !"polly.alias.scope.MemRef_B"}206!6 = !{!2}207!7 = distinct !{!7, !8, !"polly.alias.scope.MemRef_A"}208!8 = distinct !{!8, !"polly.alias.scope.domain"}209!9 = !{!10, !11}210!10 = distinct !{!10, !8, !"polly.alias.scope.MemRef_C"}211!11 = distinct !{!11, !8, !"polly.alias.scope.MemRef_B"}212!12 = !{!7, !11}213!13 = !{!10, !7}214!14 = distinct !{!14, !15}215!15 = !{!"llvm.loop.isvectorized", i32 1}216