I'd expect the following to create just one fused loop, but it creates two (two materializes):
julia> Meta.@lower (!).(1 .< A .< 2)
:($(Expr(:thunk, CodeInfo(
@ none within `top-level scope'
1 ─ %1 = Base.broadcasted(<, 1, A)
│ %2 = Base.broadcasted(<, A, 2)
│ %3 = Base.broadcasted(&, %1, %2)
│ %4 = Base.materialize(%3)
│ %5 = Base.broadcasted(!, %4)
│ %6 = Base.materialize(%5)
└── return %6
))))
It should look like:
julia> Meta.@lower (!).((1 .< A) .& (A .< 2))
:($(Expr(:thunk, CodeInfo(
@ none within `top-level scope'
1 ─ %1 = Base.broadcasted(<, 1, A)
│ %2 = Base.broadcasted(<, A, 2)
│ %3 = Base.broadcasted(&, %1, %2)
│ %4 = Base.broadcasted(!, %3)
│ %5 = Base.materialize(%4)
└── return %5
))))
I'd expect the following to create just one fused loop, but it creates two (two
materializes):It should look like: