161 lines · plain
1; ModuleID = 'matmul.ll'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 global [1536 x [1536 x float]] zeroinitializer, align 1610@B = common dso_local global [1536 x [1536 x float]] zeroinitializer, align 1611@stdout = external dso_local global %struct._IO_FILE*, align 812@.str = private unnamed_addr constant [5 x i8] c"%lf \00", align 113@C = common dso_local global [1536 x [1536 x float]] zeroinitializer, align 1614@.str.1 = private unnamed_addr constant [2 x i8] c"\0A\00", align 115 16; Function Attrs: noinline nounwind uwtable17define dso_local void @init_array() {18entry:19 br label %entry.split20 21entry.split: ; preds = %entry22 br label %for.cond1.preheader23 24for.cond1.preheader: ; preds = %entry.split, %for.inc1725 %indvars.iv4 = phi i64 [ 0, %entry.split ], [ %indvars.iv.next5, %for.inc17 ]26 br label %for.body327 28for.body3: ; preds = %for.cond1.preheader, %for.body329 %indvars.iv = phi i64 [ 0, %for.cond1.preheader ], [ %indvars.iv.next, %for.body3 ]30 %0 = mul nuw nsw i64 %indvars.iv, %indvars.iv431 %1 = trunc i64 %0 to i3232 %rem = and i32 %1, 102333 %add = add nuw nsw i32 %rem, 134 %conv = sitofp i32 %add to double35 %div = fmul double %conv, 5.000000e-0136 %conv4 = fptrunc double %div to float37 %arrayidx6 = getelementptr inbounds [1536 x [1536 x float]], [1536 x [1536 x float]]* @A, i64 0, i64 %indvars.iv4, i64 %indvars.iv38 store float %conv4, float* %arrayidx6, align 439 %arrayidx16 = getelementptr inbounds [1536 x [1536 x float]], [1536 x [1536 x float]]* @B, i64 0, i64 %indvars.iv4, i64 %indvars.iv40 store float %conv4, float* %arrayidx16, align 441 %indvars.iv.next = add nuw nsw i64 %indvars.iv, 142 %exitcond = icmp ne i64 %indvars.iv.next, 153643 br i1 %exitcond, label %for.body3, label %for.inc1744 45for.inc17: ; preds = %for.body346 %indvars.iv.next5 = add nuw nsw i64 %indvars.iv4, 147 %exitcond6 = icmp ne i64 %indvars.iv.next5, 153648 br i1 %exitcond6, label %for.cond1.preheader, label %for.end1949 50for.end19: ; preds = %for.inc1751 ret void52}53 54; Function Attrs: noinline nounwind uwtable55define dso_local void @print_array() {56entry:57 br label %entry.split58 59entry.split: ; preds = %entry60 br label %for.cond1.preheader61 62for.cond1.preheader: ; preds = %entry.split, %for.end63 %indvars.iv6 = phi i64 [ 0, %entry.split ], [ %indvars.iv.next7, %for.end ]64 %0 = load %struct._IO_FILE*, %struct._IO_FILE** @stdout, align 865 br label %for.body366 67for.body3: ; preds = %for.cond1.preheader, %for.inc68 %indvars.iv = phi i64 [ 0, %for.cond1.preheader ], [ %indvars.iv.next, %for.inc ]69 %1 = phi %struct._IO_FILE* [ %0, %for.cond1.preheader ], [ %5, %for.inc ]70 %arrayidx5 = getelementptr inbounds [1536 x [1536 x float]], [1536 x [1536 x float]]* @C, i64 0, i64 %indvars.iv6, i64 %indvars.iv71 %2 = load float, float* %arrayidx5, align 472 %conv = fpext float %2 to double73 %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)74 %3 = trunc i64 %indvars.iv to i3275 %rem = urem i32 %3, 8076 %cmp6 = icmp eq i32 %rem, 7977 br i1 %cmp6, label %if.then, label %for.inc78 79if.then: ; preds = %for.body380 %4 = load %struct._IO_FILE*, %struct._IO_FILE** @stdout, align 881 %fputc3 = tail call i32 @fputc(i32 10, %struct._IO_FILE* %4)82 br label %for.inc83 84for.inc: ; preds = %for.body3, %if.then85 %indvars.iv.next = add nuw nsw i64 %indvars.iv, 186 %5 = load %struct._IO_FILE*, %struct._IO_FILE** @stdout, align 887 %exitcond = icmp ne i64 %indvars.iv.next, 153688 br i1 %exitcond, label %for.body3, label %for.end89 90for.end: ; preds = %for.inc91 %.lcssa = phi %struct._IO_FILE* [ %5, %for.inc ]92 %fputc = tail call i32 @fputc(i32 10, %struct._IO_FILE* %.lcssa)93 %indvars.iv.next7 = add nuw nsw i64 %indvars.iv6, 194 %exitcond8 = icmp ne i64 %indvars.iv.next7, 153695 br i1 %exitcond8, label %for.cond1.preheader, label %for.end1296 97for.end12: ; preds = %for.end98 ret void99}100 101declare dso_local i32 @fprintf(%struct._IO_FILE*, i8*, ...)102 103; Function Attrs: noinline nounwind uwtable104define dso_local i32 @main() {105entry:106 br label %entry.split107 108entry.split: ; preds = %entry109 tail call void @init_array()110 br label %for.cond1.preheader111 112for.cond1.preheader: ; preds = %entry.split, %for.inc28113 %indvars.iv7 = phi i64 [ 0, %entry.split ], [ %indvars.iv.next8, %for.inc28 ]114 br label %for.body3115 116for.body3: ; preds = %for.cond1.preheader, %for.inc25117 %indvars.iv4 = phi i64 [ 0, %for.cond1.preheader ], [ %indvars.iv.next5, %for.inc25 ]118 %arrayidx5 = getelementptr inbounds [1536 x [1536 x float]], [1536 x [1536 x float]]* @C, i64 0, i64 %indvars.iv7, i64 %indvars.iv4119 store float 0.000000e+00, float* %arrayidx5, align 4120 br label %for.body8121 122for.body8: ; preds = %for.body3, %for.body8123 %indvars.iv = phi i64 [ 0, %for.body3 ], [ %indvars.iv.next, %for.body8 ]124 %0 = load float, float* %arrayidx5, align 4125 %arrayidx16 = getelementptr inbounds [1536 x [1536 x float]], [1536 x [1536 x float]]* @A, i64 0, i64 %indvars.iv7, i64 %indvars.iv126 %1 = load float, float* %arrayidx16, align 4127 %arrayidx20 = getelementptr inbounds [1536 x [1536 x float]], [1536 x [1536 x float]]* @B, i64 0, i64 %indvars.iv, i64 %indvars.iv4128 %2 = load float, float* %arrayidx20, align 4129 %mul = fmul float %1, %2130 %add = fadd float %0, %mul131 store float %add, float* %arrayidx5, align 4132 %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1133 %exitcond = icmp ne i64 %indvars.iv.next, 1536134 br i1 %exitcond, label %for.body8, label %for.inc25135 136for.inc25: ; preds = %for.body8137 %indvars.iv.next5 = add nuw nsw i64 %indvars.iv4, 1138 %exitcond6 = icmp ne i64 %indvars.iv.next5, 1536139 br i1 %exitcond6, label %for.body3, label %for.inc28140 141for.inc28: ; preds = %for.inc25142 %indvars.iv.next8 = add nuw nsw i64 %indvars.iv7, 1143 %exitcond9 = icmp ne i64 %indvars.iv.next8, 1536144 br i1 %exitcond9, label %for.cond1.preheader, label %for.end30145 146for.end30: ; preds = %for.inc28147 ret i32 0148}149 150; Function Attrs: nounwind151declare i64 @fwrite(i8* nocapture, i64, i64, %struct._IO_FILE* nocapture)152 153; Function Attrs: nounwind154declare i32 @fputc(i32, %struct._IO_FILE* nocapture)155 156!llvm.module.flags = !{!0}157!llvm.ident = !{!1}158 159!0 = !{i32 1, !"wchar_size", i32 4}160!1 = !{!"clang version 8.0.0 (trunk 342834) (llvm/trunk 342856)"}161