Skip to content

Instantly share code, notes, and snippets.

@uenoku
Created December 24, 2018 19:35
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save uenoku/ff7207a3eef801f5d94ba7a2fd2b5491 to your computer and use it in GitHub Desktop.
Save uenoku/ff7207a3eef801f5d94ba7a2fd2b5491 to your computer and use it in GitHub Desktop.
; ModuleID = 'mandelbrot.7rcbfp3g-cgu.0'
source_filename = "mandelbrot.7rcbfp3g-cgu.0"
target datalayout = "e-m:e-p:32:32-i64:64-n32-S128"
target triple = "riscv32"
%"core::panic::PanicInfo" = type { [0 x i32], { {}*, [3 x i32]* }, [0 x i32], i32*, [0 x i32], %"core::panic::Location", [0 x i32] }
%"core::panic::Location" = type { [0 x i32], { [0 x i8]*, i32 }, [0 x i32], i32, [0 x i32], i32, [0 x i32] }
; mandelbrot::start
; Function Attrs: nounwind
define internal fastcc void @_ZN10mandelbrot5start17h7d351b8658bbf2baE() unnamed_addr #0 {
start:
br label %bb6.i
bb6.i: ; preds = %bb10.i, %start
%iter.sroa.0.016.i = phi i32 [ 0, %start ], [ %4, %bb10.i ]
%0 = sitofp i32 %iter.sroa.0.016.i to float
%1 = fadd float %0, %0
%2 = fdiv float %1, 1.000000e+02
%3 = fadd float %2, -1.500000e+00
br label %bb11.i
bb10.i: ; preds = %bb20.i
%4 = add nuw nsw i32 %iter.sroa.0.016.i, 1
tail call void @print_newline() #4
%exitcond17.i = icmp eq i32 %4, 100
br i1 %exitcond17.i, label %_ZN10mandelbrot10mandelbrot17hf8c4ee19f5e67c5dE.exit, label %bb6.i
bb11.i: ; preds = %bb20.i, %bb6.i
%iter2.sroa.0.015.i = phi i32 [ 0, %bb6.i ], [ %5, %bb20.i ]
%5 = add nuw nsw i32 %iter2.sroa.0.015.i, 1
%6 = sitofp i32 %iter2.sroa.0.015.i to float
%7 = fadd float %6, %6
%8 = fdiv float %7, 1.000000e+02
%9 = fadd float %8, -1.000000e+00
br label %bb19.i
bb19.i: ; preds = %bb22.i, %bb11.i
%iter4.sroa.4.0.i = phi i32 [ 1000, %bb11.i ], [ %10, %bb22.i ]
%zi2.0.i = phi float [ 0.000000e+00, %bb11.i ], [ %18, %bb22.i ]
%zr2.0.i = phi float [ 0.000000e+00, %bb11.i ], [ %17, %bb22.i ]
%zr.0.i = phi float [ 0.000000e+00, %bb11.i ], [ %16, %bb22.i ]
%zi.0.i = phi float [ 0.000000e+00, %bb11.i ], [ %14, %bb22.i ]
%10 = add nsw i32 %iter4.sroa.4.0.i, -1
%11 = icmp eq i32 %10, 0
br i1 %11, label %bb21.i, label %bb22.i
bb20.i: ; preds = %bb25.i, %bb21.i
%exitcond.i = icmp eq i32 %5, 100
br i1 %exitcond.i, label %bb10.i, label %bb11.i
bb21.i: ; preds = %bb19.i
tail call void @print_int(i32 1) #4
br label %bb20.i
bb22.i: ; preds = %bb19.i
%12 = fadd float %zr.0.i, %zr.0.i
%13 = fmul float %12, %zi.0.i
%14 = fadd float %9, %13
%15 = fsub float %zr2.0.i, %zi2.0.i
%16 = fadd float %3, %15
%17 = fmul float %16, %16
%18 = fmul float %14, %14
%19 = fadd float %17, %18
%20 = fcmp ugt float %19, 4.000000e+00
br i1 %20, label %bb19.i, label %bb25.i
bb25.i: ; preds = %bb22.i
tail call void @print_int(i32 0) #4
br label %bb20.i
_ZN10mandelbrot10mandelbrot17hf8c4ee19f5e67c5dE.exit: ; preds = %bb10.i
ret void
}
; Function Attrs: norecurse nounwind readnone
define hidden void @rust_eh_personality() unnamed_addr #2 {
start:
ret void
}
; Function Attrs: nounwind
declare void @print_int(i32) unnamed_addr #0
; Function Attrs: nounwind
declare void @print_newline() unnamed_addr #0
; Function Attrs: nounwind
define i32 @main(i32, i8** nocapture readnone) unnamed_addr #3 {
top:
; call mandelbrot::start
tail call fastcc void @_ZN10mandelbrot5start17h7d351b8658bbf2baE()
ret i32 0
}
attributes #0 = { nounwind "target-features"="+m,+c" }
attributes #1 = { norecurse noreturn nounwind readnone "target-features"="+m,+c" }
attributes #2 = { norecurse nounwind readnone "target-features"="+m,+c" }
attributes #3 = { nounwind "target-cpu"="generic-rv32" }
attributes #4 = { nounwind }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment