Lower fused adapter trap intrinsics to CLIF trap instructions - #14113
Merged
fitzgen merged 2 commits intoAug 13, 2026
Merged
Conversation
| .value_def(trap_code) | ||
| .inst() | ||
| .expect("FACT emits an instruction for this argument"); | ||
| let ir::InstructionData::UnaryImm { |
Member
There was a problem hiding this comment.
I'm a bit wary of doing this even though it probably works out generally fine, but for example with guest-debug enabled I'd be worried that we'd spill/reload something or something like that. Could the payload here be directly on FactInlineIntrinsic::Trap? That'd require adding it to Trampoline::Trap too which I suspect wouldn't have much impact.
Member
Author
There was a problem hiding this comment.
Just pushed a commit implementing this. A bit of shepherding and such, but ultimately nicer yeah.
Before, we would emit a call to a host function, passing the trap code as a constant argument. Now we emit a `trap <code>` instruction directly. This is a large improvement for our sync adapter disas tests.
fitzgen
force-pushed
the
use-clif-trap-inst-in-fused-adapters
branch
from
August 12, 2026 21:47
2eb1c97 to
366139f
Compare
alexcrichton
approved these changes
Aug 12, 2026
fitzgen
enabled auto-merge
August 13, 2026 13:44
Merged
via the queue into
bytecodealliance:main
with commit Aug 13, 2026
cb7f6c4
104 of 106 checks passed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Before, we would emit a call to a host function, passing the trap code as a
constant argument. Now we emit a
trap <code>instruction directly.This is a large improvement for our sync adapter disas tests.
Depends on #14111