Fix overallocation of arm64 small constant localloc
authorBruce Forstall <Bruce_Forstall@msn.com>
Thu, 26 Jul 2018 23:18:44 +0000 (16:18 -0700)
committerBruce Forstall <Bruce_Forstall@msn.com>
Thu, 26 Jul 2018 23:18:44 +0000 (16:18 -0700)
commitb9523031cf5aa8ecc97f0505cfac09dbf4556e66
tree791c35478bff3482ba8dccffd78957102923df1c
parent0a8e6d922c55f59c796bb7eb4cb0e72e7da93db3
Fix overallocation of arm64 small constant localloc

We were dividing the number of bytes to allocate by 8 (right shift by 3)
to determine the number of loops, then allocating and zeroing 16 bytes
per loop.

Simplify this by removing the number of `STACK_ALIGN_SHIFT` cases we have.

Add a small test case that exhibits this behavior.

Fixes dotnet/coreclr#4571

Commit migrated from https://github.com/dotnet/coreclr/commit/7cd8f70d30963df4aa85203ba5f39f41285b2cd3
src/coreclr/src/jit/codegenarm.cpp
src/coreclr/src/jit/codegenarm64.cpp
src/coreclr/src/jit/codegenxarch.cpp
src/coreclr/src/jit/lsraarm.cpp
src/coreclr/src/jit/lsraarm64.cpp
src/coreclr/src/jit/target.h
src/coreclr/tests/src/JIT/CodeGenBringUpTests/LocallocCnstB32_Loop.cs [new file with mode: 0644]
src/coreclr/tests/src/JIT/CodeGenBringUpTests/LocallocCnstB32_Loop.csproj [new file with mode: 0644]