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)
commit7cd8f70d30963df4aa85203ba5f39f41285b2cd3
treec1dac3565677144e1541c7ba67a51e2ed977a99a
parent2b92e13d9c015de34b12487131932410148ffb80
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 #4571
src/jit/codegenarm.cpp
src/jit/codegenarm64.cpp
src/jit/codegenxarch.cpp
src/jit/lsraarm.cpp
src/jit/lsraarm64.cpp
src/jit/target.h
tests/src/JIT/CodeGenBringUpTests/LocallocCnstB32_Loop.cs [new file with mode: 0644]
tests/src/JIT/CodeGenBringUpTests/LocallocCnstB32_Loop.csproj [new file with mode: 0644]