Refactor `HasMultiRegRetVal` and `impFixupCallStructReturn`. (#36465)
authorSergey Andreenko <seandree@microsoft.com>
Fri, 15 May 2020 09:10:56 +0000 (02:10 -0700)
committerGitHub <noreply@github.com>
Fri, 15 May 2020 09:10:56 +0000 (02:10 -0700)
commitf7585699066a1ef590b23d0dea926f3f0c1a5090
treecb4648dd7ec9229387b7e336f99bfcc85fa9d8c2
parent85777ee6347c956cef6704fa4a18170d97541afb
Refactor `HasMultiRegRetVal` and `impFixupCallStructReturn`. (#36465)

* Fix target definitions.

They were used in asserts only, no changes.

* Fix failures after a recent HW changes.

* Add a const getter for `ReturnTypeDesc` from a call.

Used to make some new methods const as well.

* Refactor `HasMultiRegRetVal` and `impFixupCallStructReturn`.

Delete an unnecessary nested condition and make checks more straightforward.

* Delete an extra `.` in some dumps.

* Add an additional check that `ReturnTypeDesc` is initialized.

* Remove old `const_cast` around `GetReturnTypeDesc`.

* Replace non-const `GetReturnTypeDesc` with other methods.

* Fix uninitialized `gtSpillFlags, gtOtherRegs, gtReturnTypeDesc` in `fgMorphIntoHelperCall`.
15 files changed:
src/coreclr/src/jit/codegenarmarch.cpp
src/coreclr/src/jit/codegencommon.cpp
src/coreclr/src/jit/codegenlinear.cpp
src/coreclr/src/jit/codegenxarch.cpp
src/coreclr/src/jit/decomposelongs.cpp
src/coreclr/src/jit/gentree.cpp
src/coreclr/src/jit/gentree.h
src/coreclr/src/jit/importer.cpp
src/coreclr/src/jit/lower.cpp
src/coreclr/src/jit/lsraarmarch.cpp
src/coreclr/src/jit/lsrabuild.cpp
src/coreclr/src/jit/lsraxarch.cpp
src/coreclr/src/jit/morph.cpp
src/coreclr/src/jit/regset.cpp
src/coreclr/src/jit/target.h