Skip to content

perf: truncate to i64 before jumping to dynamic jump table#317

Open
DaniPopes wants to merge 2 commits intomainfrom
dani/truncate-i64-dynamic-jump-table
Open

perf: truncate to i64 before jumping to dynamic jump table#317
DaniPopes wants to merge 2 commits intomainfrom
dani/truncate-i64-dynamic-jump-table

Conversation

@DaniPopes
Copy link
Copy Markdown
Contributor

@DaniPopes DaniPopes commented Apr 20, 2026

Move the saturating i256-to-i64 conversion from the dynamic jump table block to each dynamic jump site. This makes the phi node i64 instead of i256, simplifying the jump table codegen while preserving correctness (values that don't fit in i64 are mapped to u64::MAX, which won't match any valid PC).

Truncate the i256 jump target to i64 at each dynamic jump site instead
of doing a saturating convert in the dynamic jump table block. This
removes the zext+icmp+select overhead from the jump table phi node,
simplifying codegen.
@codspeed-hq
Copy link
Copy Markdown

codspeed-hq bot commented Apr 20, 2026

Merging this PR will not alter performance

✅ 69 untouched benchmarks


Comparing dani/truncate-i64-dynamic-jump-table (275c49d) with main (24772e2)

Open in CodSpeed

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.

1 participant