Closed
Description
opened on Apr 6, 2017
The output of this file
eltypestuple() = Tuple{}
eltypestuple(x, xs...) = Tuple{eltype(x), eltypes(xs...).types...}
null_safe_op(::Any, ::Type, ::Type...) = false
Base.@pure null_safe_eltype_op(f, xs...) =
null_safe_op(f, eltypestuple(xs...).types...)
@inline function broadcast_c(f, a...)
if null_safe_eltype_op(f, a...)
0
else
1
end
end
f() = broadcast_c(1:10, 1:10, 1:10)
code_llvm(STDOUT, f, Tuple{})
is on 0.5, quite long; on latest 0.6, also quite long.
But briefly, around when #16961 was merged, it was just
define i64 @julia_f_61750() #0 !dbg !5 {
top:
ret i64 1
}
so something must have changed since. (The latest commit I know to have the short LLVM is 495114c, but I'll bisect to find a better bound.)
Some notes:
- If
@pure
is removed then the generated LLVM is never short; - @vtjnash pointed out that
@pure
is incorrect anyway, so we should probably still go with Refactor null_safe_op to workaround codegen changes #21290?
Activity