Simplify runtime lookup tree
authorMike Danes <onemihaid@hotmail.com>
Sun, 16 Apr 2017 11:33:46 +0000 (14:33 +0300)
committerMike Danes <onemihaid@hotmail.com>
Mon, 17 Apr 2017 06:48:54 +0000 (09:48 +0300)
commitec94afcccadb80144fd73bcae1a50127532db16e
treecf6add93345cae4b1479c2f11272a6fa39a24b8c
parent8abbec3b50262e1135609a45d4b2a0f8a2881f3d
Simplify runtime lookup tree

The current qmark tree looks like `tmp = cond ? tmp : indir` and it ends up generating a block containing `tmp = tmp` that is not eliminated.

Take advantage of the fact that qmark can have TYP_VOID and contain assignments to generate something like `if (c) { tmp = indir } else { }` that avoids the useless `tmp = tmp` assignment.

Also, the original code allocated two temporaries when one is sufficient.

Commit migrated from https://github.com/dotnet/coreclr/commit/018656367499b146ff5bad5c2cbe8c7eb7f5639e
src/coreclr/src/jit/importer.cpp