Misc LdFrameThis optimizations
commit6f7bf22f3b9e26a2e6273c4a3f41e6931717a398
authorRick Lavoie <rlavoie@fb.com>
Thu, 18 Nov 2021 22:23:11 +0000 (18 14:23 -0800)
committerFacebook GitHub Bot <facebook-github-bot@users.noreply.github.com>
Thu, 18 Nov 2021 22:29:37 +0000 (18 14:29 -0800)
tree2204c2cb8341edfdc668f1bcf3c092d161847c63
parent274c11694fde81193dfcb647886608530a5744dd
Misc LdFrameThis optimizations

Summary:
Frame state was storing information about the frame context, but the
logic wasn't complete (the merge operation wasn't even
implemented!). It only worked for inlined functions. Fix the issues
and make it work for all functions. This allows frame state to track
the known context type, and refine and elide loads as necessary.

Load-elim was not refining LdFrameThis/LdFrameCls even though it could
already easily.

I noticed GVN would sometimes add a SSATmp usage beyond a CheckType or
AssertType on that SSATmp. If GVN does anything, run refineTmps() to
take advantage of CheckTypes or AssertTypes.

Finally, I noticed in one trace that we weren't inlining an absolutely
trivial function (it simply returned false). This is because for
whatever reason we didn't have any profiling information for the
function. Add a heuristic to the inlining decider to attempt to inline
such functions anyways (take no arguments and return a known
constant).

Reviewed By: paulbiss, jano

Differential Revision: D30938880

fbshipit-source-id: bba5837f6da4daad292b28c15c1354308e4797d0
hphp/runtime/vm/jit/frame-state.cpp
hphp/runtime/vm/jit/gvn.cpp
hphp/runtime/vm/jit/inlining-decider.cpp
hphp/runtime/vm/jit/ir-builder.cpp
hphp/runtime/vm/jit/load-elim.cpp