Gonzalosilvalde opened PR #10528 from Gonzalosilvalde:6038 to bytecodealliance:main:
<!--
Please make sure you include the following information:
If this work has been discussed elsewhere, please include a link to that
conversation. If it was discussed in an issue, just mention "issue #...".Explain why this change is needed. If the details are in an issue already,
this can be brief.Our development process is documented in the Wasmtime book:
https://docs.wasmtime.dev/contributing-development-process.htmlPlease ensure all communication follows the code of conduct:
https://github.com/bytecodealliance/wasmtime/blob/main/CODE_OF_CONDUCT.md
-->Description:
This pull request addresses issue #6038 by adding an ISLE wrapper for constructing constants. The goal is to allow mid-end optimization rules to generate constants generically without needing to know whether to use
iconst,vconst,f32const,f64const, etc.Changes:
- Added a helper function
ty_vecincranelift/codegen/src/isle_prelude.rs- Defined an extractor
ty_vecin `cranelift/codegen/src/prelude.isle- Introduced a new rule in
cranelift/codegen/src/prelude_opt.islefor constructing constant nodesAdditional Notes:
- It compiles without any problem and passes the
cranelifttest.
Gonzalosilvalde requested wasmtime-compiler-reviewers for a review on PR #10528.
Gonzalosilvalde requested abrown for a review on PR #10528.
cfallin commented on PR #10528:
@Gonzalosilvalde thanks for the PR!
In order to ensure this is tested and works for our lowerings, would you mind switching over at least a few existing uses of
iconst/etc to use this instead? Looking at the issue(s) that spawned this might help to find cases to demonstrate it as well.
efJerryYang commented on PR #10528:
Hi @Gonzalosilvalde , I noticed this PR has been quiet for a while.
Would you mind if I pick this up and continue the remaining testing work in a separate PR to help move it forward?
Gonzalosilvalde commented on PR #10528:
Hi @efJerryYang ,
Yeah, continue what remains without any problem
Last updated: Dec 06 2025 at 07:03 UTC