Closed
Description
This seems like a regression: in Julia v1.9-rc2 and master
julia> using LinearAlgebra, BenchmarkTools
julia> A = rand(ComplexF64,4,4,1000,1000);
julia> B = similar(A);
julia> a,b = (view(B,:,:,1,1),view(A,:,:,1,1));
julia> @btime mul!($b,$a,$a);
321.792 ns (10 allocations: 608 bytes)
This is on an M1 Max
julia> versioninfo()
Julia Version 1.9.0-rc2
Commit 72aec423c2a (2023-04-01 10:41 UTC)
Platform Info:
OS: macOS (arm64-apple-darwin21.3.0)
CPU: 10 × Apple M1 Max
WORD_SIZE: 64
LIBM: libopenlibm
LLVM: libLLVM-14.0.6 (ORCJIT, apple-m1)
Threads: 1 on 8 virtual cores
Environment:
JULIA_EDITOR = code
But in v1.8.5 we don't allocate
julia> using LinearAlgebra, BenchmarkTools
julia> A = rand(ComplexF64,4,4,1000,1000);
julia> B = similar(A);
julia> a,b = (view(B,:,:,1,1),view(A,:,:,1,1));
julia> @btime mul!($b,$a,$a);
97.076 ns (0 allocations: 0 bytes)
Note that if A has dimensions 3 or less, this issue does not arise.