Use use-counts in fold-imms
commit120970b5a73a343c6a58b248f2ab9c0bf792f9a9
authorMark Williams <mwilliams@fb.com>
Thu, 27 Apr 2017 16:48:47 +0000 (27 09:48 -0700)
committerHhvm Bot <hhvm-bot@users.noreply.github.com>
Thu, 27 Apr 2017 17:06:33 +0000 (27 10:06 -0700)
tree60a9e595f5c79f2b1fc23418f478f69f6ba936a8
parent2b0220e427e43675186e8b4c3c1d24e170866244
Use use-counts in fold-imms

Summary:
I noticed we didn't fold byte-sized immediates into stores in
prologues, and found a special check to prevent it.

This must be because prologues store zero to the type bytes of all the
locals, and so its better to use a register (assuming there's more
than one local).

Instead, we can count the uses, and fold when there's exactly
one.

Reviewed By: edwinsmith

Differential Revision: D4954038

fbshipit-source-id: 68dfe75afbbad1fc738769dccc23664edceb8f37
hphp/runtime/vm/jit/vasm-fold-imms.cpp