You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
types = (Real, Complex)
for (i, A) inenumerate(types), (j, B) inenumerate(types)
let i = i, j = j, A = A, B = B
Base.isless(::Type{A}, ::Type{B}) = i < j
endend
julia>for (i, A) inenumerate(types), (j, B) inenumerate(types)
let i = i, j = j, A = A, B = B
Base.isless(::Type{A}, ::Type{B}) = i < j
endend
julia>@code_llvmisless(Complex, Real)
define i8 @julia_isless_65888(i8**, i8**) #0 !dbg !5 {
top:
ret i8 0
}
julia>@code_llvmisless(Real, Complex)
define i8 @julia_isless_65892(i8**, i8**) #0 !dbg !5 {
top:
ret i8 1
}
This is a simplified case from some Dates code @omus was working on.
Here is the working original code:
This is optimized to:
I was thinking one could rewrite the function definition without
@eval
using alet
block, and that works in this case (0.5 only):Optimized to:
But if I put this back in the for loop:
It doesn't optimize:
The text was updated successfully, but these errors were encountered: