; ModuleID = 'test.ibc.opt.1'
source_filename = "llvm-link"
target datalayout = "e-m:o-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-apple-macosx10.14.0"
%struct.__sFILE = type { i8*, i32, i32, i16, i16, %struct.__sbuf, i32, i8*, i32 (i8*)*, i32 (i8*, i8*, i32)*, i64 (i8*, i64, i32)*, i32 (i8*, i8*, i32)*, %struct.__sbuf, %struct.__sFILEX*, i32, [3 x
i8], [1 x
i8], %struct.__sbuf, i32, i64 }
%struct.__sFILEX = type opaque
%struct.__sbuf = type { i8*, i32 }
@.str = private unnamed_addr
constant [11 x
i8] c
"value: %f\0A\00", align 1
@.str.1 = private unnamed_addr
constant [2 x
i8] c
"r\00", align 1
@.str.2 = private unnamed_addr
constant [3 x
i8] c
"%d\00", align 1
@.str.3 = private unnamed_addr
constant [3 x
i8] c
"%f\00", align 1
@.str.4 = private unnamed_addr
constant [18 x
i8] c
"matrices/%s_a.txt\00", align 1
@.str.5 = private unnamed_addr
constant [18 x
i8] c
"matrices/%s_b.txt\00", align 1
@0 = private unnamed_addr
constant [7 x
i8] c
"-----\0A\00"
@1 = private unnamed_addr
constant [18 x
i8] c
"value_before: %f\0A\00"
@2 = private unnamed_addr
constant [17 x
i8] c
"value_after: %f\0A\00"
@3 = private unnamed_addr
constant [9 x
i8] c
"cmp: %d\0A\00"
@4 = private unnamed_addr
constant [11 x
i8] c
"function: \00"
@5 = private unnamed_addr
constant [9 x
i8] c
"sampling\00"
@6 = private unnamed_addr
constant [2 x
i8] c
"\0A\00"
@7 = private unnamed_addr
constant [15 x
i8] c
"cnt value: %d\0A\00"
@8 = private unnamed_addr
constant [14 x
i8] c
"eq value: %d\0A\00"
@9 = private unnamed_addr
constant [15 x
i8] c
"sub value: %d\0A\00"
; Function Attrs: noinline nounwind ssp uwtable
entry:
%conv = fpext float %f to double
ret void
}
; Function Attrs: noinline nounwind ssp uwtable
entry:
%mul = shl nsw i64 %conv, 2
%mul2 = mul i64 %mul, %conv
%tmp = bitcast i8* %call to float*
ret float* %tmp
}
; Function Attrs: allocsize(0)
; Function Attrs: noinline nounwind ssp uwtable
entry:
%call = call %struct.__sFILE* @"\01_fopen"(i8* %filename, i8* getelementptr inbounds ([2 x
i8], [2 x
i8]* @.str.1, i64 0, i64 0)) #
3
%call1 = call i32 (%struct.__sFILE*, i8*, ...) @fscanf(%struct.__sFILE* %call, i8* getelementptr inbounds ([3 x
i8], [3 x
i8]* @.str.2, i64 0, i64 0), i32* nonnull
%n) #
3
store i32 %call1, i32* %n, align 4
%call2 = call i32 @fclose(%struct.__sFILE* %call) #
3
%tmp = load i32, i32* %n, align 4
}
declare %struct.__sFILE* @"\01_fopen"(i8*, i8*) #
1
; Function Attrs: noinline nounwind ssp uwtable
entry:
%v = alloca float, align 4
%call = call %struct.__sFILE* @"\01_fopen"(i8* %filename, i8* getelementptr inbounds ([2 x
i8], [2 x
i8]* @.str.1, i64 0, i64 0)) #
3
store float 0.000000e+00, float* %v, align 4
br label %for.cond
for.cond: ; preds = %for.inc5, %entry
%indvars.iv2 = phi i64 [ %indvars.iv.next3, %for.inc5 ], [ 0, %entry ]
%cmp = icmp slt
i64 %indvars.iv2, %tmp
br i1 %cmp, label %for.body, label %for.end7
for.body: ; preds = %for.cond
br label %for.cond1
for.cond1: ; preds = %for.inc, %for.body
%indvars.iv = phi i64 [ %indvars.iv.next, %for.inc ], [ 0, %for.body ]
%wide.trip.count = zext i32 %n to i64
%exitcond = icmp ne
i64 %indvars.iv, %wide.trip.count
br i1 %exitcond, label %for.body3, label %for.end
for.body3: ; preds = %for.cond1
%call4 = call i32 (%struct.__sFILE*, i8*, ...) @fscanf(%struct.__sFILE* %call, i8* getelementptr inbounds ([3 x
i8], [3 x
i8]* @.str.3, i64 0, i64 0), float* nonnull
%v) #
3
%tmp6 = bitcast float* %v to i32*
%tmp7 = load i32, i32* %tmp6, align 4
%tmp8 = mul nsw i64 %indvars.iv2, %tmp5
%tmp9 = add nsw i64 %tmp8, %indvars.iv
%arrayidx = getelementptr inbounds float, float* %m, i64 %tmp9
%tmp10 = bitcast float* %arrayidx to i32*
store i32 %tmp7, i32* %tmp10, align 4
br label %for.inc
for.inc: ; preds = %for.body3
%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
br label %for.cond1
for.end: ; preds = %for.cond1
br label %for.inc5
for.inc5: ; preds = %for.end
%indvars.iv.next3 = add nuw nsw i64 %indvars.iv2, 1
br label %for.cond
for.end7: ; preds = %for.cond
%call8 = call i32 @fclose(%struct.__sFILE* %call) #
3
ret float* %m
}
; Function Attrs: noinline nounwind ssp uwtable
define void @matrix_mul(float* noalias %a, float* noalias %b, float* noalias %c, i32 %n) #
0 {
entry:
br i1 %call, label %entry.split
.c
, label %entry.split
entry.split: ; preds = %entry
br label %for.cond
for.cond: ; preds = %for.inc20, %entry.split
%indvars.iv9 = phi i64 [ %indvars.iv.next10, %for.inc20 ], [ 0, %entry.split
]
%cmp = icmp slt
i64 %indvars.iv9, %tmp13
br i1 %cmp, label %for.body, label %for.end22
for.body: ; preds = %for.cond
br label %for.cond1
for.cond1: ; preds = %for.inc17, %for.body
%indvars.iv4 = phi i64 [ %indvars.iv.next5, %for.inc17 ], [ 0, %for.body ]
%wide.trip.count7 = zext i32 %n to i64
%exitcond8 = icmp ne
i64 %indvars.iv4, %wide.trip.count7
br i1 %exitcond8, label %for.body3, label %for.end19
for.body3: ; preds = %for.cond1
br label %for.cond4
for.cond4: ; preds = %for.inc, %for.body3
%indvars.iv = phi i64 [ %indvars.iv.next, %for.inc ], [ 0, %for.body3 ]
%wide.trip.count = zext i32 %n to i64
%exitcond = icmp ne
i64 %indvars.iv, %wide.trip.count
br i1 %exitcond, label %for.body6, label %for.end
for.body6: ; preds = %for.cond4
%tmp15 = mul nsw i64 %indvars.iv9, %tmp14
%tmp16 = add nsw i64 %tmp15, %indvars.iv
%arrayidx = getelementptr inbounds float, float* %a, i64 %tmp16
%tmp17 = load float, float* %arrayidx, align 4
%tmp18 = mul nsw i64 %indvars.iv, %tmp
%tmp19 = add nsw i64 %tmp18, %indvars.iv4
%arrayidx10 = getelementptr inbounds float, float* %b, i64 %tmp19
%tmp20 = load float, float* %arrayidx10, align 4
%mul11 = fmul float %tmp17, %tmp20
%tmp21 = add nsw i64 %tmp15, %indvars.iv4
%arrayidx15 = getelementptr inbounds float, float* %c, i64 %tmp21
%tmp22 = load float, float* %arrayidx15, align 4
%add16 = fadd float %tmp22, %mul11
store float %add16, float* %arrayidx15, align 4
br label %split
split: ; preds = %for.body6
br label %for.inc
for.inc: ; preds = %split
%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
br label %for.cond4
for.end: ; preds = %for.cond4
br label %for.inc17
for.inc17: ; preds = %for.end
%indvars.iv.next5 = add nuw nsw i64 %indvars.iv4, 1
br label %for.cond1
for.end19: ; preds = %for.cond1
br label %for.inc20
for.inc20: ; preds = %for.end19
%indvars.iv.next10 = add nuw nsw i64 %indvars.iv9, 1
br label %for.cond
for.end22: ; preds = %for.cond.c, %for.cond
ret void
entry.split.c: ; preds = %entry
br label %for.cond.c
for.cond.c: ; preds = %entry.split.c, %for.inc20.c
%indvars.iv9.c = phi i64 [ %indvars.iv.next10.c, %for.inc20.c ], [ 0, %entry.split
.c
]
%cmp.c = icmp slt
i64 %indvars.iv9.c, %tmp13.c
br i1 %cmp.c, label %for.body.c, label %for.end22
for.body.c: ; preds = %for.cond.c
br label %for.cond1.c
for.cond1.c: ; preds = %for.inc17.c, %for.body.c
%indvars.iv4.c = phi i64 [ %indvars.iv.next5.c, %for.inc17.c ], [ 0, %for.body.c ]
%wide.trip.count7.c = zext i32 %n to i64
%exitcond8.c = icmp ne
i64 %indvars.iv4.c, %wide.trip.count7.c
br i1 %exitcond8.c, label %for.body3.c, label %for.end19.c
for.end19.c: ; preds = %for.cond1.c
br label %for.inc20.c
for.inc20.c: ; preds = %for.end19.c
%indvars.iv.next10.c = add nuw nsw i64 %indvars.iv9.c, 1
br label %for.cond.c
for.body3.c: ; preds = %for.cond1.c
br label %for.cond4.c
for.cond4.c: ; preds = %for.inc.c, %for.body3.c
%indvars.iv.c = phi i64 [ %indvars.iv.next.c, %for.inc.c ], [ 0, %for.body3.c ]
%wide.trip.count.c = zext i32 %n to i64
%exitcond.c = icmp ne
i64 %indvars.iv.c, %wide.trip.count.c
br i1 %exitcond.c, label %for.body6.c, label %for.end.c
for.end.c: ; preds = %for.cond4.c
br label %for.inc17.c
for.inc17.c: ; preds = %for.end.c
%indvars.iv.next5.c = add nuw nsw i64 %indvars.iv4.c, 1
br label %for.cond1.c
for.body6.c: ; preds = %for.cond4.c
%tmp15.c = mul nsw i64 %indvars.iv9.c, %tmp14.c
%tmp16.c = add nsw i64 %tmp15.c, %indvars.iv.c
%arrayidx.c = getelementptr inbounds float, float* %a, i64 %tmp16.c
%tmp17.c = load float, float* %arrayidx.c, align 4
%0 = fcmp one float %tmp17.c, 0.000000e+00
br i1 %0, label %1, label %5
; <label>:1: ; preds = %for.body6.c
%tmp18.c = mul nsw i64 %indvars.iv.c, %tmp.c
%tmp19.c = add nsw i64 %tmp18.c, %indvars.iv4.c
%arrayidx10.c = getelementptr inbounds float, float* %b, i64 %tmp19.c
%tmp20.c = load float, float* %arrayidx10.c, align 4
%2 = fcmp one float %tmp20.c, 0.000000e+00
br i1 %2, label %3, label %4
; <label>:3: ; preds = %1
%mul11.c = fmul float %tmp17.c, %tmp20.c
%tmp21.c = add nsw i64 %tmp15.c, %indvars.iv4.c
%arrayidx15.c = getelementptr inbounds float, float* %c, i64 %tmp21.c
%tmp22.c = load float, float* %arrayidx15.c, align 4
%add16.c = fadd float %tmp22.c, %mul11.c
store float %add16.c, float* %arrayidx15.c, align 4
br label %4
; <label>:4: ; preds = %1, %3
br label %5
; <label>:5: ; preds = %for.body6.c, %4
br label %split.c
for.inc.c: ; preds = %split.c
%indvars.iv.next.c = add nuw nsw i64 %indvars.iv.c, 1
br label %for.cond4.c
split.c: ; preds = %5
br label %for.inc.c
}
; Function Attrs: noinline nounwind ssp uwtable
entry:
%buf = alloca [20 x
i8], align 16
%arrayidx = getelementptr inbounds i8*, i8** %argv, i64 1
%tmp = load i8*, i8** %arrayidx, align 8
%arraydecay = getelementptr inbounds [20 x
i8], [20 x
i8]* %buf, i64 0, i64 0
%arrayidx4 = getelementptr inbounds i8*, i8** %argv, i64 2
%tmp1 = load i8*, i8** %arrayidx4, align 8
%call5 = call i32 (i8*, i64, i32, i64, i8*, ...) @__snprintf_chk(i8* nonnull
%arraydecay, i64 20, i32 0, i64 20, i8* getelementptr inbounds ([18 x
i8], [18 x
i8]* @.str.4, i64 0, i64 0), i8* %tmp1) #
3
%tmp2 = load i8*, i8** %arrayidx4, align 8
%call10 = call i32 (i8*, i64, i32, i64, i8*, ...) @__snprintf_chk(i8* nonnull
%arraydecay, i64 20, i32 0, i64 20, i8* getelementptr inbounds ([18 x
i8], [18 x
i8]* @.str.5, i64 0, i64 0), i8* %tmp2) #
3
%call12 = call float* @read_matrix(i8* nonnull
%arraydecay, float* %call2, i32 %call)
call void @matrix_mul(float* %call1, float* %call2, float* %call3, i32 %call)
}
; Function Attrs: noinline nounwind ssp uwtable
define private i1 @sampling(float* noalias %a, float* noalias %b, float* noalias %c, i32 %n) #
0 {
entry.s:
br label %entry.split.s
entry.split.s: ; preds = %entry.s
br label %for.cond.s
for.cond.s: ; preds = %for.inc20.s, %entry.split.s
%indvars.iv9.s = phi i64 [ %indvars.iv.next10.s, %for.inc20.s ], [ 0, %entry.split
.s
]
%cmp.s = icmp slt
i64 %indvars.iv9.s, %tmp13.s
br i1 %cmp.s, label %for.body.s, label %for.end22.s
for.body.s: ; preds = %for.cond.s
br label %for.cond1.s
for.cond1.s: ; preds = %for.inc17.s, %for.body.s
%indvars.iv4.s = phi i64 [ %indvars.iv.next5.s, %for.inc17.s ], [ 0, %for.body.s ]
%wide.trip.count7.s = zext i32 %n to i64
%exitcond8.s = icmp ne
i64 %indvars.iv4.s, %wide.trip.count7.s
br i1 %exitcond8.s, label %for.body3.s, label %for.end19.s
for.body3.s: ; preds = %for.cond1.s
br label %for.cond4.s
for.cond4.s: ; preds = %for.inc.s, %for.body3.s
%indvars.iv.s = phi i64 [ %indvars.iv.next.s, %for.inc.s ], [ 0, %for.body3.s ]
%wide.trip.count.s = zext i32 %n to i64
%exitcond.s = icmp ne
i64 %indvars.iv.s, %wide.trip.count.s
br i1 %exitcond.s, label %for.body6.s, label %for.end.s
for.body6.s: ; preds = %for.cond4.s
%tmp15.s = mul nsw i64 %indvars.iv9.s, %tmp14.s
%tmp16.s = add nsw i64 %tmp15.s, %indvars.iv.s
%arrayidx.s = getelementptr inbounds float, float* %a, i64 %tmp16.s
%tmp17.s = load float, float* %arrayidx.s, align 4
%tmp18.s = mul nsw i64 %indvars.iv.s, %tmp.s
%tmp19.s = add nsw i64 %tmp18.s, %indvars.iv4.s
%arrayidx10.s = getelementptr inbounds float, float* %b, i64 %tmp19.s
%tmp20.s = load float, float* %arrayidx10.s, align 4
%mul11.s = fmul float %tmp17.s, %tmp20.s
%tmp21.s = add nsw i64 %tmp15.s, %indvars.iv4.s
%arrayidx15.s = getelementptr inbounds float, float* %c, i64 %tmp21.s
%tmp22.s = load float, float* %arrayidx15.s, align 4
%add16.s = fadd float %tmp22.s, %mul11.s
%cnt_inc = add i32 %cnt4, 1
%eq_counter = load i32, i32* %eq
%fcmp = fcmp oeq float %tmp22.s, %add16.s
%call_printf_dump1 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([18 x
i8], [18 x
i8]* @1, i32 0, i32 0), float %tmp22.s)
%call_printf_dump2 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([17 x
i8], [17 x
i8]* @2, i32 0, i32 0), float %add16.s)
%eq_inc = add i32 %eq_counter, %0
br label %for.body6.s.split
for.body6.s.split: ; preds = %for.body6.s
br i1 %2, label %for.inc.s, label %function_exit
for.inc.s: ; preds = %for.body6.s.split
%indvars.iv.next.s = add nuw nsw i64 %indvars.iv.s, 1
br label %for.cond4.s
for.end.s: ; preds = %for.cond4.s
br label %for.inc17.s
for.inc17.s: ; preds = %for.end.s
%indvars.iv.next5.s = add nuw nsw i64 %indvars.iv4.s, 1
br label %for.cond1.s
for.end19.s: ; preds = %for.cond1.s
br label %for.inc20.s
for.inc20.s: ; preds = %for.end19.s
%indvars.iv.next10.s = add nuw nsw i64 %indvars.iv9.s, 1
br label %for.cond.s
function_exit: ; preds = %for.body6.s.split, %for.end22.s
%sub = sub i32 %cnt5, %eq6
%cmp = icmp sle
i32 %sub, 3
%3 = select i1 %cmp, i1 true, i1 false
for.end22.s: ; preds = %for.cond.s
br label %function_exit
}
attributes #0 = { noinline nounwind ssp uwtable "correctly-rounded-divide-sqrt-fp-math"="false" "disable-tail-calls"="false" "less-precise-fpmad"="false" "no-frame-pointer-elim"="true" "no-frame-pointer-elim-non-leaf" "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"="penryn" "target-features"="+cx16,+fxsr,+mmx,+sahf,+sse,+sse2,+sse3,+sse4.1,+ssse3,+x87" "unsafe-fp-math"="false" "use-soft-float"="false" }
attributes #1 = { "correctly-rounded-divide-sqrt-fp-math"="false" "disable-tail-calls"="false" "less-precise-fpmad"="false" "no-frame-pointer-elim"="true" "no-frame-pointer-elim-non-leaf" "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"="penryn" "target-features"="+cx16,+fxsr,+mmx,+sahf,+sse,+sse2,+sse3,+sse4.1,+ssse3,+x87" "unsafe-fp-math"="false" "use-soft-float"="false" }
attributes #2 = { allocsize(0) "correctly-rounded-divide-sqrt-fp-math"="false" "disable-tail-calls"="false" "less-precise-fpmad"="false" "no-frame-pointer-elim"="true" "no-frame-pointer-elim-non-leaf" "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"="penryn" "target-features"="+cx16,+fxsr,+mmx,+sahf,+sse,+sse2,+sse3,+sse4.1,+ssse3,+x87" "unsafe-fp-math"="false" "use-soft-float"="false" }
attributes #3 = { nounwind }
attributes #4 = { nounwind allocsize(0) }
!llvm.ident = !{!0}
!llvm.module.flags = !{!1, !2}
!0 = !{!"clang version 6.0.1 (tags/RELEASE_601/final 342957)"}
!1 = !{i32 1, !"wchar_size", i32 4}
!2 = !{i32 7, !"PIC Level", i32 2}