174 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 %for.cond1.preheader19 20for.cond1.preheader: ; preds = %for.inc17, %entry21 %indvars.iv4 = phi i64 [ 0, %entry ], [ %indvars.iv.next5, %for.inc17 ]22 br label %for.body323 24for.body3: ; preds = %for.body3, %for.cond1.preheader25 %indvars.iv = phi i64 [ 0, %for.cond1.preheader ], [ %indvars.iv.next.1, %for.body3 ]26 %0 = mul nuw nsw i64 %indvars.iv, %indvars.iv427 %1 = trunc i64 %0 to i3228 %rem = and i32 %1, 102229 %add = or i32 %rem, 130 %conv = sitofp i32 %add to double31 %div = fmul double %conv, 5.000000e-0132 %conv4 = fptrunc double %div to float33 %arrayidx6 = getelementptr inbounds [1536 x [1536 x float]], [1536 x [1536 x float]]* @A, i64 0, i64 %indvars.iv4, i64 %indvars.iv34 store float %conv4, float* %arrayidx6, align 835 %arrayidx16 = getelementptr inbounds [1536 x [1536 x float]], [1536 x [1536 x float]]* @B, i64 0, i64 %indvars.iv4, i64 %indvars.iv36 store float %conv4, float* %arrayidx16, align 837 %indvars.iv.next = or i64 %indvars.iv, 138 %2 = mul nuw nsw i64 %indvars.iv.next, %indvars.iv439 %3 = trunc i64 %2 to i3240 %rem.1 = and i32 %3, 102341 %add.1 = add nuw nsw i32 %rem.1, 142 %conv.1 = sitofp i32 %add.1 to double43 %div.1 = fmul double %conv.1, 5.000000e-0144 %conv4.1 = fptrunc double %div.1 to float45 %arrayidx6.1 = getelementptr inbounds [1536 x [1536 x float]], [1536 x [1536 x float]]* @A, i64 0, i64 %indvars.iv4, i64 %indvars.iv.next46 store float %conv4.1, float* %arrayidx6.1, align 447 %arrayidx16.1 = getelementptr inbounds [1536 x [1536 x float]], [1536 x [1536 x float]]* @B, i64 0, i64 %indvars.iv4, i64 %indvars.iv.next48 store float %conv4.1, float* %arrayidx16.1, align 449 %indvars.iv.next.1 = add nuw nsw i64 %indvars.iv, 250 %exitcond.1 = icmp eq i64 %indvars.iv.next.1, 153651 br i1 %exitcond.1, label %for.inc17, label %for.body352 53for.inc17: ; preds = %for.body354 %indvars.iv.next5 = add nuw nsw i64 %indvars.iv4, 155 %exitcond6 = icmp eq i64 %indvars.iv.next5, 153656 br i1 %exitcond6, label %for.end19, label %for.cond1.preheader57 58for.end19: ; preds = %for.inc1759 ret void60}61 62; Function Attrs: noinline nounwind uwtable63define dso_local void @print_array() local_unnamed_addr {64entry:65 br label %for.cond1.preheader66 67for.cond1.preheader: ; preds = %for.end, %entry68 %indvars.iv6 = phi i64 [ 0, %entry ], [ %indvars.iv.next7, %for.end ]69 %0 = load %struct._IO_FILE*, %struct._IO_FILE** @stdout, align 870 br label %for.body371 72for.body3: ; preds = %for.inc, %for.cond1.preheader73 %indvars.iv = phi i64 [ 0, %for.cond1.preheader ], [ %indvars.iv.next, %for.inc ]74 %1 = phi %struct._IO_FILE* [ %0, %for.cond1.preheader ], [ %5, %for.inc ]75 %arrayidx5 = getelementptr inbounds [1536 x [1536 x float]], [1536 x [1536 x float]]* @C, i64 0, i64 %indvars.iv6, i64 %indvars.iv76 %2 = load float, float* %arrayidx5, align 477 %conv = fpext float %2 to double78 %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)79 %3 = trunc i64 %indvars.iv to i3280 %rem = urem i32 %3, 8081 %cmp6 = icmp eq i32 %rem, 7982 br i1 %cmp6, label %if.then, label %for.inc83 84if.then: ; preds = %for.body385 %4 = load %struct._IO_FILE*, %struct._IO_FILE** @stdout, align 886 %fputc3 = tail call i32 @fputc(i32 10, %struct._IO_FILE* %4)87 br label %for.inc88 89for.inc: ; preds = %if.then, %for.body390 %indvars.iv.next = add nuw nsw i64 %indvars.iv, 191 %5 = load %struct._IO_FILE*, %struct._IO_FILE** @stdout, align 892 %exitcond = icmp eq i64 %indvars.iv.next, 153693 br i1 %exitcond, label %for.end, label %for.body394 95for.end: ; preds = %for.inc96 %fputc = tail call i32 @fputc(i32 10, %struct._IO_FILE* %5)97 %indvars.iv.next7 = add nuw nsw i64 %indvars.iv6, 198 %exitcond8 = icmp eq i64 %indvars.iv.next7, 153699 br i1 %exitcond8, label %for.end12, label %for.cond1.preheader100 101for.end12: ; preds = %for.end102 ret void103}104 105; Function Attrs: nounwind106declare dso_local i32 @fprintf(%struct._IO_FILE* nocapture, i8* nocapture readonly, ...) local_unnamed_addr107 108; Function Attrs: noinline norecurse nounwind uwtable109define dso_local i32 @main() local_unnamed_addr {110entry:111 tail call void @init_array()112 br label %for.cond1.preheader113 114for.cond1.preheader: ; preds = %for.inc28, %entry115 %indvars.iv7 = phi i64 [ 0, %entry ], [ %indvars.iv.next8, %for.inc28 ]116 br label %for.body3117 118for.body3: ; preds = %for.inc25, %for.cond1.preheader119 %indvars.iv4 = phi i64 [ 0, %for.cond1.preheader ], [ %indvars.iv.next5, %for.inc25 ]120 %arrayidx5 = getelementptr inbounds [1536 x [1536 x float]], [1536 x [1536 x float]]* @C, i64 0, i64 %indvars.iv7, i64 %indvars.iv4121 store float 0.000000e+00, float* %arrayidx5, align 4122 br label %for.body8123 124for.body8: ; preds = %for.body8, %for.body3125 %add1 = phi float [ 0.000000e+00, %for.body3 ], [ %add.2, %for.body8 ]126 %indvars.iv = phi i64 [ 0, %for.body3 ], [ %indvars.iv.next.2, %for.body8 ]127 %arrayidx16 = getelementptr inbounds [1536 x [1536 x float]], [1536 x [1536 x float]]* @A, i64 0, i64 %indvars.iv7, i64 %indvars.iv128 %0 = load float, float* %arrayidx16, align 4129 %arrayidx20 = getelementptr inbounds [1536 x [1536 x float]], [1536 x [1536 x float]]* @B, i64 0, i64 %indvars.iv, i64 %indvars.iv4130 %1 = load float, float* %arrayidx20, align 4131 %mul = fmul float %0, %1132 %add = fadd float %add1, %mul133 %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1134 %arrayidx16.1 = getelementptr inbounds [1536 x [1536 x float]], [1536 x [1536 x float]]* @A, i64 0, i64 %indvars.iv7, i64 %indvars.iv.next135 %2 = load float, float* %arrayidx16.1, align 4136 %arrayidx20.1 = getelementptr inbounds [1536 x [1536 x float]], [1536 x [1536 x float]]* @B, i64 0, i64 %indvars.iv.next, i64 %indvars.iv4137 %3 = load float, float* %arrayidx20.1, align 4138 %mul.1 = fmul float %2, %3139 %add.1 = fadd float %add, %mul.1140 %indvars.iv.next.1 = add nuw nsw i64 %indvars.iv, 2141 %arrayidx16.2 = getelementptr inbounds [1536 x [1536 x float]], [1536 x [1536 x float]]* @A, i64 0, i64 %indvars.iv7, i64 %indvars.iv.next.1142 %4 = load float, float* %arrayidx16.2, align 4143 %arrayidx20.2 = getelementptr inbounds [1536 x [1536 x float]], [1536 x [1536 x float]]* @B, i64 0, i64 %indvars.iv.next.1, i64 %indvars.iv4144 %5 = load float, float* %arrayidx20.2, align 4145 %mul.2 = fmul float %4, %5146 %add.2 = fadd float %add.1, %mul.2147 %indvars.iv.next.2 = add nuw nsw i64 %indvars.iv, 3148 %exitcond.2 = icmp eq i64 %indvars.iv.next.2, 1536149 br i1 %exitcond.2, label %for.inc25, label %for.body8150 151for.inc25: ; preds = %for.body8152 store float %add.2, float* %arrayidx5, align 4153 %indvars.iv.next5 = add nuw nsw i64 %indvars.iv4, 1154 %exitcond6 = icmp eq i64 %indvars.iv.next5, 1536155 br i1 %exitcond6, label %for.inc28, label %for.body3156 157for.inc28: ; preds = %for.inc25158 %indvars.iv.next8 = add nuw nsw i64 %indvars.iv7, 1159 %exitcond9 = icmp eq i64 %indvars.iv.next8, 1536160 br i1 %exitcond9, label %for.end30, label %for.cond1.preheader161 162for.end30: ; preds = %for.inc28163 ret i32 0164}165 166; Function Attrs: nounwind167declare i32 @fputc(i32, %struct._IO_FILE* nocapture) local_unnamed_addr168 169!llvm.module.flags = !{!0}170!llvm.ident = !{!1}171 172!0 = !{i32 1, !"wchar_size", i32 4}173!1 = !{!"clang version 8.0.0 (trunk 342834) (llvm/trunk 342856)"}174