Assign registers to unused dests unless the opcode is whitelisted.
commit20cad04adf2d8bc63202af177fa356cde5a92363
authorEdwin Smith <smith@fb.com>
Wed, 19 Feb 2014 17:56:03 +0000 (19 09:56 -0800)
committerSara Golemon <sgolemon@fb.com>
Wed, 26 Feb 2014 22:31:12 +0000 (26 14:31 -0800)
tree4cee03a7641dc8db30f4f78fb814d41768612597
parent738b78d517c56eae4446ce5037f5f98b0cd0be51
Assign registers to unused dests unless the opcode is whitelisted.

If an opcode's dest is unused and can be eliminated by DCE, then
there's no good reason to check for an InvalidReg dest in that
opcode.  Have the register allocator just give it a dest.

Opcodes which are effect-ful may stick around even if their
result is unused.  A subset of those opcodes can emit better
code if the dest is unused.  Whitelist just those opcodes.

This diff makes the default be to assign a register to unused
dests, if the opcode is not whitelisted, and removes the
invalid-dest checking from several opcodes in CodeGenerator.

Reviewed By: @swtaarrs

Differential Revision: D1187390
hphp/runtime/vm/jit/code-gen-x64.cpp
hphp/runtime/vm/jit/reg-alloc.cpp
hphp/runtime/vm/jit/reg-alloc.h
hphp/runtime/vm/jit/xls.cpp