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