Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refactor local.set register preservation #786

Merged
merged 1 commit into from
Nov 19, 2023

Conversation

Robbepop
Copy link
Member

@Robbepop Robbepop commented Nov 19, 2023

Closes #766

This fixes a bug in preservation of local.set for local variables that have been pushed multiple times onto the stack upon preservation and implements recycling of preservation slots to reduce register pressure.

This fixes a bug in preservation of `local.set` for local variables that have been pushed multiple times onto the stack upon preservation and implements recycling of preservation slots to reduce register pressure.
@Robbepop Robbepop changed the title refactor local.set register preservation Refactor local.set register preservation Nov 19, 2023
@paritytech-cicd-pr
Copy link

BENCHMARKS

NATIVEWASMTIME
BENCHMARKMASTERPRDIFFMASTERPRDIFFWASMTIME OVERHEAD
execute/
bare_call_0
1.66ms 1.55ms 🟢 -6.45% 1.13ms 1.08ms 🟢 -4.58% 🟢 -31%
execute/
bare_call_0/typed
1.17ms 1.18ms ⚪ 1.03% 788.55µs 783.17µs ⚪ -1.00% 🟢 -34%
execute/
bare_call_1
1.74ms 1.61ms 🟢 -7.39% 1.30ms 1.26ms 🔴 -3.23% 🟢 -22%
execute/
bare_call_16
2.59ms 2.53ms 🟢 -2.03% 3.44ms 3.39ms 🟢 -1.53% 🟢 34%
execute/
bare_call_16/typed
1.58ms 1.56ms 🟢 -1.57% 1.90ms 1.82ms 🟢 -4.71% 🟢 17%
execute/
bare_call_1/typed
1.32ms 1.27ms 🟢 -3.40% 1.04ms 1.14ms 🔴 8.94% 🟢 -10%
execute/
bare_call_4
1.78ms 1.78ms 🟢 -0.02% 1.72ms 1.63ms 🟢 -5.26% 🟢 -8%
execute/
bare_call_4/typed
1.32ms 1.22ms 🟢 -7.43% 1.13ms 1.06ms 🟢 -6.41% 🟢 -14%
execute/
br_table
1.40ms 1.38ms ⚪ -1.72% 1.19ms 1.19ms ⚪ 0.13% 🟢 -14%
execute/
count_until
575.38µs 620.58µs 🔴 7.89% 1.29ms 1.30ms ⚪ 0.48% 🔴 110%
execute/
factorial_iterative
319.88µs 321.56µs ⚪ 0.47% 576.40µs 575.42µs ⚪ -0.06% 🟡 79%
execute/
factorial_recursive
495.43µs 493.96µs ⚪ -0.25% 759.04µs 753.17µs ⚪ -0.84% 🟡 52%
execute/
fibonacci_iter
1.66ms 1.40ms 🟢 -15.98% 2.78ms 2.79ms ⚪ 0.28% 🟡 99%
execute/
fibonacci_rec
3.97ms 3.97ms ⚪ -0.09% 6.68ms 6.68ms ⚪ 0.05% 🟡 68%
execute/
fibonacci_tail
863.98µs 857.10µs ⚪ -0.79% 1.64ms 1.64ms ⚪ 0.19% 🟡 91%
execute/
global_bump
730.53µs 747.67µs 🔴 2.48% 1.66ms 1.69ms ⚪ 1.18% 🔴 126%
execute/
global_const
681.35µs 659.01µs 🟢 -3.38% 1.34ms 1.35ms ⚪ 0.17% 🔴 104%
execute/
host_calls
37.17µs 37.13µs ⚪ 0.20% 39.08µs 38.43µs 🟢 -1.70% 🟢 3%
execute/
memory_fill
1.19ms 1.15ms 🟢 -3.37% 2.45ms 2.45ms ⚪ -0.02% 🔴 113%
execute/
memory_sum
1.13ms 1.14ms ⚪ 0.08% 2.40ms 2.41ms ⚪ 0.31% 🔴 112%
execute/
memory_vec_add
2.35ms 2.35ms ⚪ -0.06% 5.29ms 5.28ms ⚪ 1.23% 🔴 124%
execute/
recursive_is_even
667.75µs 664.61µs ⚪ -0.48% 1.12ms 1.12ms ⚪ 0.35% 🟡 69%
execute/
recursive_ok
93.52µs 95.13µs 🔴 1.64% 169.79µs 169.59µs ⚪ -0.20% 🟡 78%
execute/
recursive_scan
129.88µs 129.94µs ⚪ 0.08% 227.89µs 227.76µs ⚪ -0.11% 🟡 75%
execute/
recursive_trap
8.70µs 8.86µs 🔴 1.82% 17.14µs 17.06µs ⚪ -0.48% 🟡 93%
execute/
regex_redux
455.96µs 461.26µs 🔴 1.29% 890.35µs 895.53µs ⚪ 0.60% 🟡 94%
execute/
rev_complement
425.14µs 422.53µs ⚪ -0.75% 863.55µs 869.91µs ⚪ 0.58% 🔴 106%
execute/
tiny_keccak
320.34µs 333.02µs 🔴 3.59% 672.81µs 671.23µs ⚪ -0.14% 🔴 102%
execute/
trunc_f2i
727.79µs 738.30µs 🔴 1.60% 1.70ms 1.71ms ⚪ 0.18% 🔴 131%
instantiate/
wasm_kernel
55.16µs 54.85µs ⚪ 0.20% 57.96µs 55.71µs 🟢 -4.47% 🟢 2%
translate/
erc1155
209.56µs 208.27µs ⚪ -0.80% 356.46µs 359.20µs ⚪ 0.60% 🟡 72%
translate/
erc20
104.09µs 104.38µs ⚪ 0.26% 173.21µs 174.06µs ⚪ 0.54% 🟡 67%
translate/
erc721
146.65µs 146.38µs ⚪ -0.20% 250.15µs 252.41µs ⚪ 0.92% 🟡 72%
translate/
spidermonkey
64.67ms 64.41ms ⚪ -0.53% 0.00ns 0.00ns ⚪ 0.73% 🟢 -100%
translate/
wasm_kernel
4.32ms 4.25ms 🟢 -1.60% 6.50ms 6.51ms ⚪ -0.08% 🟡 53%

Link to pipeline

@Robbepop Robbepop merged commit 7911bd2 into master Nov 19, 2023
13 checks passed
@Robbepop Robbepop deleted the rf-improve-local-set-preservation branch November 19, 2023 12:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Recycle preservation register slots if possible.
2 participants