Optimize `CAST(int <- long)` on 32 bit targets (#53040)
authorSingleAccretion <62474226+SingleAccretion@users.noreply.github.com>
Fri, 25 Jun 2021 06:32:44 +0000 (09:32 +0300)
committerGitHub <noreply@github.com>
Fri, 25 Jun 2021 06:32:44 +0000 (23:32 -0700)
commitb5b8863005d0d95cc470be458108b5176396a522
tree70c992404c64802c8c7a0ec427ce1adb951e0622
parentcef40a107ff2f810219b3b28af709b0b778a3472
Optimize `CAST(int <- long)` on 32 bit targets (#53040)

* Optimize CAST(int <- long) on 32 bit targets

* Revert "Optimize CAST(int <- long) on 32 bit targets"

Revert the implementation in lowering

* Optimize CAST(int <- long) on 32 bit targets

Move the code from lowering to long decomposition.

* Fixed the "Arguments" note for DecomposeNode

* Added the function header

For OptimizeCastFromDecomposedLong.

* Remove the TODO comment

While correct, it has questionable value.

* Add a more detailed dump output

* Do not try to optimize checked casts

It is easy to get it wrong. Let the frontend handle this.

* Do not depend on tree order

Previous version of the code assumed that there could be
no nodes between the cast and its operand. That is not
a correct assumption to make in LIR.
src/coreclr/jit/decomposelongs.cpp
src/coreclr/jit/decomposelongs.h