Aarch64 - improve after lea lowering
commit57cf791a9c67922ea6da5cf1ab6690a2bbedd666
authorSteve Walk <steve.walk@cavium.com>
Tue, 13 Feb 2018 00:30:46 +0000 (12 16:30 -0800)
committerHhvm Bot <hhvm-bot@users.noreply.github.com>
Tue, 13 Feb 2018 00:39:13 +0000 (12 16:39 -0800)
treef57be9afdad4f83667712f2245bd34e144fac8e3
parentcb1de43a5ea0a4414b263f5d4794e0878c581dba
Aarch64 - improve after lea lowering

Summary:
This change improves the sequence generated when lowering the Vptr element of the lea
Vinstr by taking advantage of the sub immediate instruction.  This saves 1 instruction
per instance.

Before
=====
    (07) StLocRange<[0, 108)> t0:FramePtr, Uninit
        Main:
            0x52c0035c  d10043a0              sub x0, x29, #0x10 (16)
            0x52c00360  9280d9e1              movn x1, #0x6cf
            0x52c00364  8b0103a1              add x1, x29, x1
            0x52c00368  3900201f              strb wzr, [x0, #8]

After
====
    (07) StLocRange<[0, 108)> t0:FramePtr, Uninit
        Main:
            0x50400404  d10043a0              sub x0, x29, #0x10 (16)
            0x50400408  d11b43a1              sub x1, x29, #0x6d0 (1744)  //<<---
            0x5040040c  3900201f              strb wzr, [x0, #8]

This was seen approximately 300 times in hphp/test/quick/all_type_comparison_test.php
and around 1000 times in hphp/test/zend/good/ext/intl/tests/grapheme.php

The standard regression tests were run with six option sets.  No new failures were observed.
Closes https://github.com/facebook/hhvm/pull/7929

Differential Revision: D5706712

Pulled By: mxw

fbshipit-source-id: 09dd2597677567a965e00992dfeb6d8121a1bc69
hphp/runtime/vm/jit/vasm-simplify-arm.cpp