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 16 10@B = common dso_local local_unnamed_addr global [1536 x [1536 x float]] zeroinitializer, align 16 11@stdout = external dso_local local_unnamed_addr global %struct._IO_FILE*, align 8 12@.str = private unnamed_addr constant [5 x i8] c"%lf \00", align 1 13@C = common dso_local local_unnamed_addr global [1536 x [1536 x float]] zeroinitializer, align 16 14 15; Function Attrs: noinline norecurse nounwind uwtable writeonly 16define dso_local void @init_array() local_unnamed_addr #0 { 17entry: 18 br label %polly.loop_header 19 20polly.exiting: ; preds = %polly.loop_exit3 21 ret void 22 23polly.loop_header: ; preds = %polly.loop_exit3, %entry 24 %polly.indvar = phi i64 [ 0, %entry ], [ %polly.indvar_next, %polly.loop_exit3 ] 25 %0 = trunc i64 %polly.indvar to i32 26 br label %polly.loop_header1 27 28polly.loop_exit3: ; preds = %polly.loop_header1 29 %polly.indvar_next = add nuw nsw i64 %polly.indvar, 1 30 %exitcond1 = icmp eq i64 %polly.indvar_next, 1536 31 br i1 %exitcond1, label %polly.exiting, label %polly.loop_header 32 33polly.loop_header1: ; preds = %polly.loop_header1, %polly.loop_header 34 %polly.indvar4 = phi i64 [ 0, %polly.loop_header ], [ %polly.indvar_next5.1, %polly.loop_header1 ] 35 %1 = trunc i64 %polly.indvar4 to i32 36 %2 = mul nuw nsw i32 %1, %0 37 %3 = and i32 %2, 1022 38 %4 = or i32 %3, 1 39 %p_conv = sitofp i32 %4 to double 40 %p_div = fmul double %p_conv, 5.000000e-01 41 %p_conv4 = fptrunc double %p_div to float 42 %scevgep7 = getelementptr [1536 x [1536 x float]], [1536 x [1536 x float]]* @A, i64 0, i64 %polly.indvar, i64 %polly.indvar4 43 store float %p_conv4, float* %scevgep7, align 8, !alias.scope !2, !noalias !4 44 %scevgep9 = getelementptr [1536 x [1536 x float]], [1536 x [1536 x float]]* @B, i64 0, i64 %polly.indvar, i64 %polly.indvar4 45 store float %p_conv4, float* %scevgep9, align 8, !alias.scope !5, !noalias !6 46 %polly.indvar_next5 = or i64 %polly.indvar4, 1 47 %5 = trunc i64 %polly.indvar_next5 to i32 48 %6 = mul nuw nsw i32 %5, %0 49 %7 = and i32 %6, 1023 50 %8 = add nuw nsw i32 %7, 1 51 %p_conv.1 = sitofp i32 %8 to double 52 %p_div.1 = fmul double %p_conv.1, 5.000000e-01 53 %p_conv4.1 = fptrunc double %p_div.1 to float 54 %scevgep7.1 = getelementptr [1536 x [1536 x float]], [1536 x [1536 x float]]* @A, i64 0, i64 %polly.indvar, i64 %polly.indvar_next5 55 store float %p_conv4.1, float* %scevgep7.1, align 4, !alias.scope !2, !noalias !4 56 %scevgep9.1 = getelementptr [1536 x [1536 x float]], [1536 x [1536 x float]]* @B, i64 0, i64 %polly.indvar, i64 %polly.indvar_next5 57 store float %p_conv4.1, float* %scevgep9.1, align 4, !alias.scope !5, !noalias !6 58 %polly.indvar_next5.1 = add nuw nsw i64 %polly.indvar4, 2 59 %exitcond.1 = icmp eq i64 %polly.indvar_next5.1, 1536 60 br i1 %exitcond.1, label %polly.loop_exit3, label %polly.loop_header1 61} 62 63; Function Attrs: noinline nounwind uwtable 64define dso_local void @print_array() local_unnamed_addr #1 { 65entry: 66 br label %for.cond1.preheader 67 68for.cond1.preheader: ; preds = %for.end, %entry 69 %indvars.iv6 = phi i64 [ 0, %entry ], [ %indvars.iv.next7, %for.end ] 70 %0 = load %struct._IO_FILE*, %struct._IO_FILE** @stdout, align 8 71 br label %for.body3 72 73for.body3: ; preds = %for.inc, %for.cond1.preheader 74 %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.iv 77 %2 = load float, float* %arrayidx5, align 4 78 %conv = fpext float %2 to double 79 %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) #4 80 %3 = trunc i64 %indvars.iv to i32 81 %rem = urem i32 %3, 80 82 %cmp6 = icmp eq i32 %rem, 79 83 br i1 %cmp6, label %if.then, label %for.inc 84 85if.then: ; preds = %for.body3 86 %4 = load %struct._IO_FILE*, %struct._IO_FILE** @stdout, align 8 87 %fputc3 = tail call i32 @fputc(i32 10, %struct._IO_FILE* %4) 88 br label %for.inc 89 90for.inc: ; preds = %if.then, %for.body3 91 %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1 92 %5 = load %struct._IO_FILE*, %struct._IO_FILE** @stdout, align 8 93 %exitcond = icmp eq i64 %indvars.iv.next, 1536 94 br i1 %exitcond, label %for.end, label %for.body3 95 96for.end: ; preds = %for.inc 97 %fputc = tail call i32 @fputc(i32 10, %struct._IO_FILE* %5) 98 %indvars.iv.next7 = add nuw nsw i64 %indvars.iv6, 1 99 %exitcond8 = icmp eq i64 %indvars.iv.next7, 1536 100 br i1 %exitcond8, label %for.end12, label %for.cond1.preheader 101 102for.end12: ; preds = %for.end 103 ret void 104} 105 106; Function Attrs: nounwind 107declare dso_local i32 @fprintf(%struct._IO_FILE* nocapture, i8* nocapture readonly, ...) local_unnamed_addr #2 108 109; Function Attrs: noinline norecurse nounwind uwtable 110define dso_local i32 @main() local_unnamed_addr #3 { 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_header8 115 116polly.exiting: ; preds = %polly.loop_exit16 117 ret i32 0 118 119polly.loop_header8: ; preds = %polly.loop_exit16, %entry 120 %polly.indvar11 = phi i64 [ %polly.indvar_next12, %polly.loop_exit16 ], [ 0, %entry ] 121 br label %polly.loop_header14 122 123polly.loop_exit16: ; preds = %polly.loop_exit22 124 %polly.indvar_next12 = add nuw nsw i64 %polly.indvar11, 1 125 %exitcond2 = icmp eq i64 %polly.indvar_next12, 1536 126 br i1 %exitcond2, label %polly.exiting, label %polly.loop_header8 127 128polly.loop_header14: ; preds = %polly.loop_exit22, %polly.loop_header8 129 %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.indvar17 131 %_p_scalar_30 = load float, float* %scevgep29, align 4, !alias.scope !7, !noalias !9 132 %broadcast.splatinsert10 = insertelement <4 x float> undef, float %_p_scalar_30, i32 0 133 %broadcast.splat11 = shufflevector <4 x float> %broadcast.splatinsert10, <4 x float> undef, <4 x i32> zeroinitializer 134 %broadcast.splatinsert12 = insertelement <4 x float> undef, float %_p_scalar_30, i32 0 135 %broadcast.splat13 = shufflevector <4 x float> %broadcast.splatinsert12, <4 x float> undef, <4 x i32> zeroinitializer 136 br label %vector.body 137 138vector.body: ; preds = %vector.body, %polly.loop_header14 139 %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 %index 141 %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 !12 143 %2 = getelementptr float, float* %0, i64 4 144 %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 !12 146 %4 = getelementptr [1536 x [1536 x float]], [1536 x [1536 x float]]* @B, i64 0, i64 %polly.indvar17, i64 %index 147 %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 !13 149 %6 = getelementptr float, float* %4, i64 4 150 %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 !13 152 %8 = fmul <4 x float> %broadcast.splat11, %wide.load8 153 %9 = fmul <4 x float> %broadcast.splat13, %wide.load9 154 %10 = fadd <4 x float> %wide.load, %8 155 %11 = fadd <4 x float> %wide.load7, %9 156 %12 = bitcast float* %0 to <4 x float>* 157 store <4 x float> %10, <4 x float>* %12, align 16, !alias.scope !10, !noalias !12 158 %13 = bitcast float* %2 to <4 x float>* 159 store <4 x float> %11, <4 x float>* %13, align 16, !alias.scope !10, !noalias !12 160 %index.next = or i64 %index, 8 161 %14 = getelementptr [1536 x [1536 x float]], [1536 x [1536 x float]]* @C, i64 0, i64 %polly.indvar11, i64 %index.next 162 %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 !12 164 %16 = getelementptr float, float* %14, i64 4 165 %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 !12 167 %18 = getelementptr [1536 x [1536 x float]], [1536 x [1536 x float]]* @B, i64 0, i64 %polly.indvar17, i64 %index.next 168 %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 !13 170 %20 = getelementptr float, float* %18, i64 4 171 %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 !13 173 %22 = fmul <4 x float> %broadcast.splat11, %wide.load8.1 174 %23 = fmul <4 x float> %broadcast.splat13, %wide.load9.1 175 %24 = fadd <4 x float> %wide.load.1, %22 176 %25 = fadd <4 x float> %wide.load7.1, %23 177 %26 = bitcast float* %14 to <4 x float>* 178 store <4 x float> %24, <4 x float>* %26, align 16, !alias.scope !10, !noalias !12 179 %27 = bitcast float* %16 to <4 x float>* 180 store <4 x float> %25, <4 x float>* %27, align 16, !alias.scope !10, !noalias !12 181 %index.next.1 = add nuw nsw i64 %index, 16 182 %28 = icmp eq i64 %index.next.1, 1536 183 br i1 %28, label %polly.loop_exit22, label %vector.body, !llvm.loop !14 184 185polly.loop_exit22: ; preds = %vector.body 186 %polly.indvar_next18 = add nuw nsw i64 %polly.indvar17, 1 187 %exitcond1 = icmp eq i64 %polly.indvar_next18, 1536 188 br i1 %exitcond1, label %polly.loop_exit16, label %polly.loop_header14 189} 190 191; Function Attrs: nounwind 192declare i32 @fputc(i32, %struct._IO_FILE* nocapture) local_unnamed_addr #4 193 194; Function Attrs: argmemonly nounwind 195declare void @llvm.memset.p0i8.i64(i8* nocapture writeonly, i8, i64, i1) #5 196 197attributes #0 = { noinline norecurse nounwind uwtable writeonly "correctly-rounded-divide-sqrt-fp-math"="false" "disable-tail-calls"="false" "less-precise-fpmad"="false" "frame-pointer"="all" "no-infs-fp-math"="false" "no-jump-tables"="false" "no-nans-fp-math"="false" "no-signed-zeros-fp-math"="false" "no-trapping-math"="false" "polly-optimized" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+fxsr,+mmx,+sse,+sse2,+x87" "unsafe-fp-math"="false" "use-soft-float"="false" } 198attributes #1 = { noinline nounwind uwtable "correctly-rounded-divide-sqrt-fp-math"="false" "disable-tail-calls"="false" "less-precise-fpmad"="false" "frame-pointer"="all" "no-infs-fp-math"="false" "no-jump-tables"="false" "no-nans-fp-math"="false" "no-signed-zeros-fp-math"="false" "no-trapping-math"="false" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+fxsr,+mmx,+sse,+sse2,+x87" "unsafe-fp-math"="false" "use-soft-float"="false" } 199attributes #2 = { nounwind "correctly-rounded-divide-sqrt-fp-math"="false" "disable-tail-calls"="false" "less-precise-fpmad"="false" "frame-pointer"="all" "no-infs-fp-math"="false" "no-nans-fp-math"="false" "no-signed-zeros-fp-math"="false" "no-trapping-math"="false" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+fxsr,+mmx,+sse,+sse2,+x87" "unsafe-fp-math"="false" "use-soft-float"="false" } 200attributes #3 = { noinline norecurse nounwind uwtable "correctly-rounded-divide-sqrt-fp-math"="false" "disable-tail-calls"="false" "less-precise-fpmad"="false" "frame-pointer"="all" "no-infs-fp-math"="false" "no-jump-tables"="false" "no-nans-fp-math"="false" "no-signed-zeros-fp-math"="false" "no-trapping-math"="false" "polly-optimized" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+fxsr,+mmx,+sse,+sse2,+x87" "unsafe-fp-math"="false" "use-soft-float"="false" } 201attributes #4 = { nounwind } 202attributes #5 = { argmemonly nounwind } 203 204!llvm.module.flags = !{!0} 205!llvm.ident = !{!1} 206 207!0 = !{i32 1, !"wchar_size", i32 4} 208!1 = !{!"clang version 8.0.0 (trunk 342834) (llvm/trunk 342856)"} 209!2 = distinct !{!2, !3, !"polly.alias.scope.MemRef_A"} 210!3 = distinct !{!3, !"polly.alias.scope.domain"} 211!4 = !{!5} 212!5 = distinct !{!5, !3, !"polly.alias.scope.MemRef_B"} 213!6 = !{!2} 214!7 = distinct !{!7, !8, !"polly.alias.scope.MemRef_A"} 215!8 = distinct !{!8, !"polly.alias.scope.domain"} 216!9 = !{!10, !11} 217!10 = distinct !{!10, !8, !"polly.alias.scope.MemRef_C"} 218!11 = distinct !{!11, !8, !"polly.alias.scope.MemRef_B"} 219!12 = !{!7, !11} 220!13 = !{!10, !7} 221!14 = distinct !{!14, !15} 222!15 = !{!"llvm.loop.isvectorized", i32 1} 223