diff --git a/test/boundscheck_exec.jl b/test/boundscheck_exec.jl index 62a20921bd44e..f86baca82bbef 100644 --- a/test/boundscheck_exec.jl +++ b/test/boundscheck_exec.jl @@ -251,5 +251,13 @@ if bc_opt == bc_default || bc_opt == bc_off @test occursin("vector.body", sprint(code_llvm, g27079, Tuple{Vector{Int}})) end +# Ensure broadcasting can vectorize when bounds checks are off +if bc_opt != bc_on + function goo28126(u, uprev, k1, k2, k3, k4, k5, k6, k7) + @. u = uprev + 0.1*(0.1*k1 + 0.2*k2 + 0.3*k3 + 0.4*k4 + 0.5*k5 + 0.6*k6 + 0.7*k7) + nothing + end + @test occursin("vector.body", sprint(code_llvm, goo28126, NTuple{9, Vector{Float32}})) +end end diff --git a/test/broadcast.jl b/test/broadcast.jl index 483e3ebe01ee5..0430dd2eb4bd6 100644 --- a/test/broadcast.jl +++ b/test/broadcast.jl @@ -791,7 +791,6 @@ let end @testset "large fusions vectorize and don't allocate (#28126)" begin - using InteractiveUtils: code_llvm u, uprev, k1, k2, k3, k4, k5, k6, k7 = (ones(1000) for i in 1:9) function goo(u, uprev, k1, k2, k3, k4, k5, k6, k7) @. u = uprev + 0.1*(0.1*k1 + 0.2*k2 + 0.3*k3 + 0.4*k4 + 0.5*k5 + 0.6*k6 + 0.7*k7) @@ -799,7 +798,6 @@ end end @allocated goo(u, uprev, k1, k2, k3, k4, k5, k6, k7) @test @allocated(goo(u, uprev, k1, k2, k3, k4, k5, k6, k7)) == 0 - @test occursin("vector.body", sprint(code_llvm, goo, NTuple{9, Vector{Float32}})) end # Broadcasted iterable/indexable APIs