Aarch64 - loadb/movxbl -> loadzbl peephole
commitcce2ec77ff1f51275ae52d9ee365e6412f0fbb70
authorSteve Walk <Steve.Walk@cavium.com>
Wed, 8 Feb 2017 20:13:42 +0000 (8 12:13 -0800)
committerHhvm Bot <hhvm-bot@users.noreply.github.com>
Wed, 8 Feb 2017 20:32:35 +0000 (8 12:32 -0800)
tree8a5c9aaea0a8f2af23439f391f87a59123133eff
parent71a09ed2a935c3260c0cec312c993cf073a1ddc0
Aarch64 - loadb/movxbl -> loadzbl peephole

Summary:
On Aarch64 the loadb/movxbl sequence would generate ldrsb/uxtb.
This occurred around the  Vinstr cmpbm instructions.  It is equivalent to just use
the ldrb instruction and save one instruction per instance.

Before
====
    14854    0: FPushFuncD 0 "ut_main"
    14855     (03) EndGuards
    14856     (07) t3:Func = LdFuncCached<ut_main> -> B2<Catch>
    14857         Main:
    14858               0x296008b0  d28217e0              movz x0, #0x10bf
    14859               0x296008b4  38e06b60              ldrsb w0, [x27, x0]     // <<--+
    14860               0x296008b8  53001c00              uxtb w0, w0             // <<--+
    14861               0x296008bc  d29fffe1              movz x1, #0xffff
    14862               0x296008c0  f2a05fe1              movk x1, #0x2ff, lsl #16
    14863               0x296008c4  38616b61              ldrb w1, [x27, x1]
    14864               0x296008c8  6b00003f              cmp w1, w0

After
=====
     320    0: FPushFuncD 0 "ut_main"
     32
Closes https://github.com/facebook/hhvm/pull/7593

Differential Revision: D4442877

Pulled By: mxw

fbshipit-source-id: 04af9bc4ce61ece185e6fa225b1b12950f0bab58
hphp/runtime/vm/jit/vasm-simplify.cpp