Skip to content

Commit 2543c3d

Browse files
committed
Move vectorization test to boundscheck
1 parent a3c95a6 commit 2543c3d

File tree

2 files changed

+8
-2
lines changed

2 files changed

+8
-2
lines changed

test/boundscheck_exec.jl

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -251,5 +251,13 @@ if bc_opt == bc_default || bc_opt == bc_off
251251
@test occursin("vector.body", sprint(code_llvm, g27079, Tuple{Vector{Int}}))
252252
end
253253

254+
# Ensure broadcasting can vectorize when bounds checks are off
255+
if bc_opt != bc_on
256+
function goo28126(u, uprev, k1, k2, k3, k4, k5, k6, k7)
257+
@. 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)
258+
nothing
259+
end
260+
@test occursin("vector.body", sprint(code_llvm, goo28126, NTuple{9, Vector{Float32}}))
261+
end
254262

255263
end

test/broadcast.jl

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -791,15 +791,13 @@ let
791791
end
792792

793793
@testset "large fusions vectorize and don't allocate (#28126)" begin
794-
using InteractiveUtils: code_llvm
795794
u, uprev, k1, k2, k3, k4, k5, k6, k7 = (ones(1000) for i in 1:9)
796795
function goo(u, uprev, k1, k2, k3, k4, k5, k6, k7)
797796
@. 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)
798797
nothing
799798
end
800799
@allocated goo(u, uprev, k1, k2, k3, k4, k5, k6, k7)
801800
@test @allocated(goo(u, uprev, k1, k2, k3, k4, k5, k6, k7)) == 0
802-
@test occursin("vector.body", sprint(code_llvm, goo, NTuple{9, Vector{Float32}}))
803801
end
804802

805803
# Broadcasted iterable/indexable APIs

0 commit comments

Comments
 (0)