Skip to content

arch64 - Improve instruction used in reuseImmq - #8265

Closed
swalk-cavium wants to merge 1 commit into
meta:masterfrom
swalk-cavium:cavium_dev_07192018
Closed

swalk-cavium wants to merge 1 commit into
meta:masterfrom
swalk-cavium:cavium_dev_07192018

Conversation

@swalk-cavium

Copy link
Copy Markdown
Contributor

While examining the log file produced for zend/good/ext/intl/tests/grapheme.php
I noticed some code generation that could be improved. There were several thousand
add instructions that really didn't contribute.

I traced it down to the reuseImmq optimization. If there is no bias, a copy
instruction could be generated. This would then later be elided after register
allocation.

Before

    (18) DecRef<-> t3:Cell 
        Main:   
          0x44400284  d29fff02              movz x2, #0xfff8 
          0x44400288  f2a05fe2              movk x2, #0x2ff, lsl #16 
          0x4440028c  78626b63              ldrh w3, [x27, x2] 
          0x44400290  13003c63              sxth w3, w3
          0x44400294  3100047f              cmn w3, #0x1 (1) 
          0x44400298  1a9f07e3              cset w3, ne
          0x4440029c  91000042              add x2, x2, #0x0 (0)    //<<---
          0x444002a0  78626b64              ldrh w4, [x27, x2] 
          0x444002a4  0b030084              add w4, w4, w3
          0x444002a8  78226b64              strh w4, [x27, x2] 
          0x444002ac  7200003f              tst w1, #0x1

After

   (18) DecRef<-> t3:Cell 
      Main:   
          0x27000284  d29fff02              movz x2, #0xfff8 
          0x27000288  f2a05fe2              movk x2, #0x2ff, lsl #16
          0x2700028c  78626b63              ldrh w3, [x27, x2]
          0x27000290  13003c63              sxth w3, w3
          0x27000294  3100047f              cmn w3, #0x1 (1)
          0x27000298  1a9f07e3              cset w3, ne
          0x2700029c  78626b64              ldrh w4, [x27, x2]
          0x270002a0  0b030084              add w4, w4, w3
          0x270002a4  78226b64              strh w4, [x27, x2]
          0x270002a8  7200003f              tst w1, #0x1

The standard regression tests were run with 6 option sets. No new issues were
seen.

@swalk-cavium

Copy link
Copy Markdown
Contributor Author

@max - Can you review?

@swalk-cavium swalk-cavium changed the title improve instruction used in reuseImmq arch64 - Improve instruction used in reuseImmq Sep 18, 2018

@hhvm-bot hhvm-bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ottoni has imported this pull request. If you are a Facebook employee, you can view this diff on Phabricator.

@hhvm-bot hhvm-bot closed this in b769c51 Sep 21, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants