Advertisement
Guest User

Untitled

a guest
Sep 30th, 2016
122
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Julia 1.80 KB | None | 0 0
  1.  
  2. function test1(x)
  3.     y = 2.0
  4.     u = 2.320
  5.     x < 0 && (u = 32.0)
  6.     x > 1 && (u = 1.0)
  7.     return u + y
  8. end
  9.  
  10.  
  11. function test2(x)
  12.     y = 2.0
  13.     u = 2.320
  14.     u = x < 0 ? 32.0 : u
  15.     u = x > 1 ? 1.0 : u
  16.     return u + y
  17. end
  18.  
  19.  
  20.  
  21.  
  22. @code_llvm test1(2.2)
  23.  
  24.  
  25. ; Function Attrs: uwtable
  26. define double @julia_test1_71850(double) #0 {
  27. top:
  28.   %1 = fcmp uge double %0, 0.000000e+00
  29.   br i1 %1, label %L, label %if
  30.  
  31. L:                                                ; preds = %if, %top
  32.   %u.0 = phi double [ 2.320000e+00, %top ], [ 3.200000e+01, %if ]
  33.   %2 = fcmp ule double %0, 1.000000e+00
  34.   br i1 %2, label %L1, label %if2
  35.  
  36. L1:                                               ; preds = %if2, %L
  37.   %u.1 = phi double [ %u.0, %L ], [ 1.000000e+00, %if2 ]
  38.   %3 = fadd double %u.1, 2.000000e+00
  39.   ret double %3
  40.  
  41. if:                                               ; preds = %top
  42.   br label %L
  43.  
  44. if2:                                              ; preds = %L
  45.   br label %L1
  46. }
  47.  
  48.  
  49. @code_llvm test2(2.2)
  50.  
  51. ; Function Attrs: uwtable
  52. define double @julia_test2_71853(double) #0 {
  53. top:
  54.   %1 = fcmp uge double %0, 0.000000e+00
  55.   br i1 %1, label %L2, label %if
  56.  
  57. L2:                                               ; preds = %top, %if
  58.   %"#temp#.sroa.0.0" = phi i64 [ 4629700416936869888, %if ], [ 4612406594367767183, %top ]
  59.   %2 = fcmp ule double %0, 1.000000e+00
  60.   br i1 %2, label %L4, label %if5
  61.  
  62. L4:                                               ; preds = %L2, %if5
  63.   %"#temp#1.sroa.0.0" = phi i64 [ 4607182418800017408, %if5 ], [ %"#temp#.sroa.0.0", %L2 ]
  64.   %.cast = bitcast i64 %"#temp#1.sroa.0.0" to double
  65.   %3 = fadd double %.cast, 2.000000e+00
  66.   ret double %3
  67.  
  68. if:                                               ; preds = %top
  69.   br label %L2
  70.  
  71. if5:                                              ; preds = %L2
  72.   br label %L4
  73. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement