You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
nudt-compiler-cpp/test_outputs/95_float.ll

281 lines
9.8 KiB

; ModuleID = '/tmp/nudt_float_fallback_EB5hgk.c'
source_filename = "/tmp/nudt_float_fallback_EB5hgk.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@RADIUS = dso_local constant float 5.500000e+00, align 4
@PI = dso_local constant float 0x400921FB60000000, align 4
@EPS = dso_local constant float 0x3EB0C6F7A0000000, align 4
@PI_HEX = dso_local constant float 0x400921FB60000000, align 4
@HEX2 = dso_local constant float 7.812500e-02, align 4
@FACT = dso_local constant float -3.300000e+04, align 4
@EVAL1 = dso_local constant float 0x4057C21FC0000000, align 4
@EVAL2 = dso_local constant float 0x4041475CE0000000, align 4
@EVAL3 = dso_local constant float 0x4041475CE0000000, align 4
@CONV1 = dso_local constant float 2.330000e+02, align 4
@CONV2 = dso_local constant float 4.095000e+03, align 4
@MAX = dso_local constant i32 1000000000, align 4
@TWO = dso_local constant i32 2, align 4
@THREE = dso_local constant i32 3, align 4
@FIVE = dso_local constant i32 5, align 4
; Function Attrs: noinline nounwind optnone uwtable
define dso_local float @float_abs(float noundef %0) #0 {
%2 = alloca float, align 4
%3 = alloca float, align 4
store float %0, ptr %3, align 4
%4 = load float, ptr %3, align 4
%5 = fcmp olt float %4, 0.000000e+00
br i1 %5, label %6, label %9
6: ; preds = %1
%7 = load float, ptr %3, align 4
%8 = fneg float %7
store float %8, ptr %2, align 4
br label %11
9: ; preds = %1
%10 = load float, ptr %3, align 4
store float %10, ptr %2, align 4
br label %11
11: ; preds = %9, %6
%12 = load float, ptr %2, align 4
ret float %12
}
; Function Attrs: noinline nounwind optnone uwtable
define dso_local float @circle_area(i32 noundef %0) #0 {
%2 = alloca i32, align 4
store i32 %0, ptr %2, align 4
%3 = load i32, ptr %2, align 4
%4 = sitofp i32 %3 to float
%5 = fmul float 0x400921FB60000000, %4
%6 = load i32, ptr %2, align 4
%7 = sitofp i32 %6 to float
%8 = load i32, ptr %2, align 4
%9 = load i32, ptr %2, align 4
%10 = mul nsw i32 %8, %9
%11 = sitofp i32 %10 to float
%12 = fmul float %11, 0x400921FB60000000
%13 = call float @llvm.fmuladd.f32(float %5, float %7, float %12)
%14 = fdiv float %13, 2.000000e+00
ret float %14
}
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare float @llvm.fmuladd.f32(float, float, float) #1
; Function Attrs: noinline nounwind optnone uwtable
define dso_local i32 @float_eq(float noundef %0, float noundef %1) #0 {
%3 = alloca i32, align 4
%4 = alloca float, align 4
%5 = alloca float, align 4
store float %0, ptr %4, align 4
store float %1, ptr %5, align 4
%6 = load float, ptr %4, align 4
%7 = load float, ptr %5, align 4
%8 = fsub float %6, %7
%9 = call float @float_abs(float noundef %8)
%10 = fcmp olt float %9, 0x3EB0C6F7A0000000
br i1 %10, label %11, label %12
11: ; preds = %2
store i32 1, ptr %3, align 4
br label %13
12: ; preds = %2
store i32 0, ptr %3, align 4
br label %13
13: ; preds = %12, %11
%14 = load i32, ptr %3, align 4
ret i32 %14
}
; Function Attrs: noinline nounwind optnone uwtable
define dso_local void @error() #0 {
call void @putch(i32 noundef 101)
call void @putch(i32 noundef 114)
call void @putch(i32 noundef 114)
call void @putch(i32 noundef 111)
call void @putch(i32 noundef 114)
call void @putch(i32 noundef 10)
ret void
}
declare void @putch(i32 noundef) #2
; Function Attrs: noinline nounwind optnone uwtable
define dso_local void @ok() #0 {
call void @putch(i32 noundef 111)
call void @putch(i32 noundef 107)
call void @putch(i32 noundef 10)
ret void
}
; Function Attrs: noinline nounwind optnone uwtable
define dso_local void @assert(i32 noundef %0) #0 {
%2 = alloca i32, align 4
store i32 %0, ptr %2, align 4
%3 = load i32, ptr %2, align 4
%4 = icmp ne i32 %3, 0
br i1 %4, label %6, label %5
5: ; preds = %1
call void @error()
br label %7
6: ; preds = %1
call void @ok()
br label %7
7: ; preds = %6, %5
ret void
}
; Function Attrs: noinline nounwind optnone uwtable
define dso_local void @assert_not(i32 noundef %0) #0 {
%2 = alloca i32, align 4
store i32 %0, ptr %2, align 4
%3 = load i32, ptr %2, align 4
%4 = icmp ne i32 %3, 0
br i1 %4, label %5, label %6
5: ; preds = %1
call void @error()
br label %7
6: ; preds = %1
call void @ok()
br label %7
7: ; preds = %6, %5
ret void
}
; Function Attrs: noinline nounwind optnone uwtable
define dso_local i32 @main() #0 {
%1 = alloca i32, align 4
%2 = alloca i32, align 4
%3 = alloca i32, align 4
%4 = alloca [10 x float], align 16
%5 = alloca i32, align 4
%6 = alloca float, align 4
%7 = alloca float, align 4
%8 = alloca float, align 4
store i32 0, ptr %1, align 4
%9 = call i32 @float_eq(float noundef 7.812500e-02, float noundef -3.300000e+04)
call void @assert_not(i32 noundef %9)
%10 = call i32 @float_eq(float noundef 0x4057C21FC0000000, float noundef 0x4041475CE0000000)
call void @assert_not(i32 noundef %10)
%11 = call i32 @float_eq(float noundef 0x4041475CE0000000, float noundef 0x4041475CE0000000)
call void @assert(i32 noundef %11)
%12 = call float @circle_area(i32 noundef 5)
%13 = call float @circle_area(i32 noundef 5)
%14 = call i32 @float_eq(float noundef %12, float noundef %13)
call void @assert(i32 noundef %14)
%15 = call i32 @float_eq(float noundef 2.330000e+02, float noundef 4.095000e+03)
call void @assert_not(i32 noundef %15)
br i1 true, label %16, label %17
16: ; preds = %0
call void @ok()
br label %17
17: ; preds = %16, %0
call void @ok()
call void @ok()
store i32 1, ptr %2, align 4
store i32 0, ptr %3, align 4
call void @llvm.memset.p0.i64(ptr align 16 %4, i8 0, i64 40, i1 false)
%18 = getelementptr inbounds <{ float, float, [8 x float] }>, ptr %4, i32 0, i32 0
store float 1.000000e+00, ptr %18, align 16
%19 = getelementptr inbounds <{ float, float, [8 x float] }>, ptr %4, i32 0, i32 1
store float 2.000000e+00, ptr %19, align 4
%20 = getelementptr inbounds [10 x float], ptr %4, i64 0, i64 0
%21 = call i32 @getfarray(ptr noundef %20)
store i32 %21, ptr %5, align 4
br label %22
22: ; preds = %25, %17
%23 = load i32, ptr %2, align 4
%24 = icmp slt i32 %23, 1000000000
br i1 %24, label %25, label %52
25: ; preds = %22
%26 = call float @getfloat()
store float %26, ptr %6, align 4
%27 = load float, ptr %6, align 4
%28 = fmul float 0x400921FB60000000, %27
%29 = load float, ptr %6, align 4
%30 = fmul float %28, %29
store float %30, ptr %7, align 4
%31 = load float, ptr %6, align 4
%32 = fptosi float %31 to i32
%33 = call float @circle_area(i32 noundef %32)
store float %33, ptr %8, align 4
%34 = load i32, ptr %3, align 4
%35 = sext i32 %34 to i64
%36 = getelementptr inbounds [10 x float], ptr %4, i64 0, i64 %35
%37 = load float, ptr %36, align 4
%38 = load float, ptr %6, align 4
%39 = fadd float %37, %38
%40 = load i32, ptr %3, align 4
%41 = sext i32 %40 to i64
%42 = getelementptr inbounds [10 x float], ptr %4, i64 0, i64 %41
store float %39, ptr %42, align 4
%43 = load float, ptr %7, align 4
call void @putfloat(float noundef %43)
call void @putch(i32 noundef 32)
%44 = load float, ptr %8, align 4
%45 = fptosi float %44 to i32
call void @putint(i32 noundef %45)
call void @putch(i32 noundef 10)
%46 = load i32, ptr %2, align 4
%47 = sitofp i32 %46 to double
%48 = fmul double %47, 1.000000e+01
%49 = fptosi double %48 to i32
store i32 %49, ptr %2, align 4
%50 = load i32, ptr %3, align 4
%51 = add nsw i32 %50, 1
store i32 %51, ptr %3, align 4
br label %22, !llvm.loop !6
52: ; preds = %22
%53 = load i32, ptr %5, align 4
%54 = getelementptr inbounds [10 x float], ptr %4, i64 0, i64 0
call void @putfarray(i32 noundef %53, ptr noundef %54)
ret i32 0
}
; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: write)
declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #3
declare i32 @getfarray(ptr noundef) #2
declare float @getfloat() #2
declare void @putfloat(float noundef) #2
declare void @putint(i32 noundef) #2
declare void @putfarray(i32 noundef, ptr noundef) #2
attributes #0 = { noinline nounwind optnone uwtable "frame-pointer"="all" "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #2 = { "frame-pointer"="all" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nocallback nofree nounwind willreturn memory(argmem: write) }
!llvm.module.flags = !{!0, !1, !2, !3, !4}
!llvm.ident = !{!5}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{i32 7, !"frame-pointer", i32 2}
!5 = !{!"Ubuntu clang version 18.1.3 (1ubuntu1)"}
!6 = distinct !{!6, !7}
!7 = !{!"llvm.loop.mustprogress"}