pulley: Add some macro-instructions related to bounds-checks#9943
Conversation
This commit starts down the path of optimizing wasm loads/stores in Pulley with macro-instructions. It's expected that these instructions are so common that it's worth putting them in the 1-byte namespace of opcodes. Locally this gets a 10% speedup on the sightglass bz2 benchmark.
|
This additionally shrinks spidermonkey.cwasm from 28M to 21M |
Subscribe to Label Actioncc @fitzgen DetailsThis issue or pull request has been labeled: "cranelift", "pulley"Thus the following users have been cc'd because of the following labels:
To subscribe or unsubscribe from this label, edit the |
| ;; wasm[0]::function[0]::load8: | ||
| ;; push_frame | ||
| ;; xload32le_offset8 x6, x0, 52 | ||
| ;; br_if_xulteq32 x6, x2, 0x14 // target = 0x19 |
There was a problem hiding this comment.
We don't want this one to use the new xbc macro-op?
There was a problem hiding this comment.
No we probably do but I wanted to add this here for complete-ness to show that it's not currently using the new op. One-byte loads/stores are generated a bit differently with bounds checks and use a >= condition instead of > + arithmetic to test whether something is out of bounds. That made it so it doesn't fall into the patterns I added and would need a specific opcode just for the one-byte access. I figured it's probably fine to leave that off for now and add in the future if necessary
This commit starts down the path of optimizing wasm loads/stores in Pulley with macro-instructions. It's expected that these instructions are so common that it's worth putting them in the 1-byte namespace of opcodes.
Locally this gets a 10% speedup on the sightglass bz2 benchmark.