JIT: clear up some no-op casts in the importer (#17996)
authorAndy Ayers <andya@microsoft.com>
Fri, 18 May 2018 19:58:59 +0000 (12:58 -0700)
committerGitHub <noreply@github.com>
Fri, 18 May 2018 19:58:59 +0000 (12:58 -0700)
commit5bd38293ed527413950ef03bded1a12ca20af5b1
tree2fb8f0ac964a3a7fbf398cb65a5588e7274314bc
parent55461ca277e43e04a9197d981d10852aa0719316
JIT: clear up some no-op casts in the importer (#17996)

If we see a no-op cast (say converting long to ulong) where the operand
to be cast already has the right stack type, don't generate a GT_CAST,
just use the operand.

This comes up in some cases with unsafe operations where the pointer type
is cast. Interposing a cast between an GT_IND and GT_ADDR results in poor
codegen as the jit thinks the addressed local is address taken.
src/jit/importer.cpp