Optimize away undefined values from value component of TNull
commit3ebcd0524debe45f3e6b922832839a5e7c3c8b23
authorJan Oravec <jan@fb.com>
Mon, 6 Apr 2020 14:51:01 +0000 (6 07:51 -0700)
committerFacebook GitHub Bot <facebook-github-bot@users.noreply.github.com>
Mon, 6 Apr 2020 14:54:11 +0000 (6 07:54 -0700)
treeb1ff29f846533c20212b9cf49a07c4bfcf516d7a
parentd97ea99fac56f338a209f62ccc5e79b1eabbafcc
Optimize away undefined values from value component of TNull

Summary:
We emit a plenty of unnecessary `xor r, r`s to clear a register holding a value
component of TNull, especially when such value is used in a ternary or being
returned from a function.

Let's add a `ldundefq` to define such registers, use the existing register
allocator logic to issue these instructions right before non-optimizable use
(such as phijmp) and emit them as a noop.

Reviewed By: ricklavoie

Differential Revision: D20861091

fbshipit-source-id: dc8b24d332750c6f700d92585b3798a98aa945e2
hphp/runtime/vm/jit/vasm-arm.cpp
hphp/runtime/vm/jit/vasm-graph-color.cpp
hphp/runtime/vm/jit/vasm-info.cpp
hphp/runtime/vm/jit/vasm-instr.cpp
hphp/runtime/vm/jit/vasm-instr.h
hphp/runtime/vm/jit/vasm-ppc64.cpp
hphp/runtime/vm/jit/vasm-print.cpp
hphp/runtime/vm/jit/vasm-simplify.cpp
hphp/runtime/vm/jit/vasm-unit.h
hphp/runtime/vm/jit/vasm-x64.cpp