Advertisement
Zelatrix

if_ir

Jul 2nd, 2021
37
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.87 KB | None | 0 0
  1. ; ModuleID = "D:\early-deliverable\codegen.py"
  2. target triple = "x86_64-pc-windows-msvc"
  3. target datalayout = ""
  4.  
  5. define void @"main"()
  6. {
  7. entry:
  8. %".2" = bitcast [6 x i8]* @"fstr" to i64*
  9. %".3" = alloca double
  10. store double 0x4024000000000000, double* %".3"
  11. %".5" = load double, double* %".3"
  12. %".6" = fcmp ogt double %".5", 0x0
  13. %".7" = uitofp i1 %".6" to double
  14. %".8" = fptosi double %".7" to i1
  15. br i1 %".8", label %"entry.if", label %"entry.endif"
  16. entry.if:
  17. %".10" = load double, double* %".3"
  18. %".11" = call i32 (i64*, ...) @"printf"(i64* %".2", double %".10")
  19. %".12" = load double, double* %".3"
  20. %".13" = fsub double %".12", 0x3ff0000000000000
  21. store double %".13", double* %".3"
  22. br label %"entry.endif"
  23. entry.endif:
  24. ret void
  25. }
  26.  
  27. declare i32 @"printf"(i64* %".1", ...)
  28.  
  29. @"fstr" = internal constant [6 x i8] c"%lf \0a\00"
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement