Implementation of CSE for GT_CNS_INT benefits ARM64 (#39096)
authorBrian Sullivan <briansul@microsoft.com>
Fri, 24 Jul 2020 00:20:46 +0000 (17:20 -0700)
committerGitHub <noreply@github.com>
Fri, 24 Jul 2020 00:20:46 +0000 (17:20 -0700)
commit90619d5d3577f2aaddf670ee6bf431f393afccaf
tree69fb78fcf6438f457102e29bc00dbdd6e047f279
parentdf35f269e351b8ed51e7746ab561387fef7bf865
Implementation of CSE for GT_CNS_INT benefits ARM64 (#39096)

* Change the type of csdHashKey to size_t

* Update gtCostSz and gtCostEx for constant nodes

* Implementation of code size optimization, CSE of constant values for ARM64
Implementation of code size optimization, CSE of constant values for ARM64
We will share a single CSE for constants that differ only in their low 12 bits on ARM64

Number of shared constant low bits set in target.h  CSE_CONST_SHARED_LOW_BITS
we use 12 bits on Arm platforms and 16 bits on XArch platforms

Disable the CSE of the REG_R2R_INDIRECT_PARAM on Arm32
as it hits  Assertion failed 'candidates != candidateBit' in lsra.cpp Line: 3723

Config variable: COMPlus_JitConstCSE
// Default 0: enable the CSE of Constants, including nearby offsets. (only for ARM64)
// If 1, disable all the CSE of Constants
// If 2, enable the CSE of Constants but don't combine with nearby offsets. (only for ARM64)
// If 3, enable the CSE of Constants including nearby offsets. (all platforms)
// If 4, enable the CSE of Constants but don't combine with nearby offsets. (all platforms)
//

* Added additional Priority 0 test coverage for Floating Point optimizations

* Fix for COMPLUS_JitConstCSE=4

* Renamed config variable from COMPlus_JitDisableConstCSE to COMPlus_JitConstCSE

* Updated with Codereview feedback, removed sort from Const CSE phase

* Fix for assertionProp issue in the refTypesdynamic test
18 files changed:
src/coreclr/src/jit/compiler.h
src/coreclr/src/jit/gentree.cpp
src/coreclr/src/jit/jitconfigvalues.h
src/coreclr/src/jit/morph.cpp
src/coreclr/src/jit/optcse.cpp
src/coreclr/src/jit/target.h
src/tests/JIT/IL_Conformance/Old/Conformance_Base/beq_r4.ilproj
src/tests/JIT/IL_Conformance/Old/Conformance_Base/beq_r8.ilproj
src/tests/JIT/IL_Conformance/Old/Conformance_Base/bge_r4.ilproj
src/tests/JIT/IL_Conformance/Old/Conformance_Base/bge_r8.ilproj
src/tests/JIT/IL_Conformance/Old/Conformance_Base/bge_un_r4.ilproj
src/tests/JIT/IL_Conformance/Old/Conformance_Base/bge_un_r8.ilproj
src/tests/JIT/IL_Conformance/Old/Conformance_Base/bne_un_r4.ilproj
src/tests/JIT/IL_Conformance/Old/Conformance_Base/bne_un_r8.ilproj
src/tests/JIT/Methodical/NaN/arithm64_cs_d.csproj
src/tests/JIT/Methodical/NaN/arithm64_cs_do.csproj
src/tests/JIT/Methodical/NaN/arithm64_cs_r.csproj
src/tests/JIT/Methodical/NaN/arithm64_cs_ro.csproj