[release/6.0] Fix incorrect SIMD temp allocation for Vector256 with AVX2 disabled...
authorgithub-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Thu, 9 Sep 2021 18:18:26 +0000 (11:18 -0700)
committerGitHub <noreply@github.com>
Thu, 9 Sep 2021 18:18:26 +0000 (11:18 -0700)
commit614c782790eceb2f4247e6e380db548a58b55a69
tree75ac92842380fc860377564598b5ae2b6526ad66
parent4c814fa006c7178eaf4549fada27ec4a6f7d42dd
[release/6.0] Fix incorrect SIMD temp allocation for Vector256 with AVX2 disabled (#58850)

* Fix incorrect SIMD temp allocation for Vector256 with AVX2 disabled

The NI_Vector256_GetElement intrinsic, in some situations, requires
a stack temporary. With AVX2 disabled, this temporary was getting
allocated as a TYP_SIMD16 instead of a TYP_SIMD32, leading to overwriting
the local variable.

Add a type argument to the temp variable allocation, and allocate the
temp as the largest sized type required by any use.

Fixes #58295

* Code review change: improve arm64 SIMD temp creation type

Co-authored-by: Bruce Forstall <brucefo@microsoft.com>
src/coreclr/jit/compiler.h
src/coreclr/jit/lsraarm64.cpp
src/coreclr/jit/lsraxarch.cpp
src/coreclr/jit/simd.cpp