mvanhorn opened PR #15022 from mvanhorn:fix/11050-clif-util-riscv64-settings to bytecodealliance:main:
Motivation
It addresses the behavior reported in issue #11050.
What this changes
This change edits
cranelift/src/compile.rsandcranelift/src/run.rs. The edited code sits inOptions,runandhandle_module. Across 3 files the diff adds 868 lines and removes 48.How it was tested
Tests for the wasmtime Options change live in
cranelift/tests/clif-util.rs. The targeted tests for the wasmtime Options change pass locally. The tests incranelift/tests/clif-util.rsfail without the fix in the wasmtime Options change (checked by reverting the source changes).Fixes #11050
AI was used for assistance.
mvanhorn removed the review request for wasmtime-compiler-reviewers from PR #15022.
mvanhorn requested cfallin for a review on PR #15022.
mvanhorn requested wasmtime-compiler-reviewers for a review on PR #15022.
github-actions[bot] added the label cranelift on PR #15022.
:memo: cfallin submitted PR review:
Thanks for the PR, @mvanhorn. However I have to admit I'm having trouble wrapping my head around this -- it's an absolutely enormous PR for the functionality and adds a lot of special cases for something that (IMHO) we'd prefer to be simple and predictable. A few thoughts:
- The original
riscv64vsriscv64gcmismatch in the reported issue is I think one of the root problems. Those are different ISAs from a target-triple perspective and it's probably more predictable if our tools don't try to fudge one to become the other; I don't like thatrunhas an existing special case and I don't want to propagate it further.- The absolutely enormous blob of (presumably LLM-generated) unit-tests here is out-of-place and unnecessary, I think.
Could you see if you could try to resolve the issue in a simpler way? Unifying behavior between
compileandrunis a totally reasonable goal, for what it's worth! I just don't want to see +868 lines of code and riscv-specific test cases and all this complexity to resolve it, is all. Thanks!
:memo: cfallin submitted PR review:
Thanks for the PR, @mvanhorn. However I have to admit I'm having trouble wrapping my head around this -- it's an absolutely enormous PR for the functionality and adds a lot of special cases for something that (IMHO) we'd prefer to be simple and predictable. A few thoughts:
- The original
riscv64vsriscv64gcmismatch in the reported issue is I think one of the root problems. Those are different ISAs from a target-triple perspective and it's probably more predictable if our tools don't try to fudge one to become the other; I don't like thatrunhas an existing special case and I don't want to propagate it further.- The absolutely enormous blob of (presumably LLM-generated) unit-tests here is out-of-place and unnecessary, I think.
Could you see if you could try to resolve the issue in a simpler way? Unifying behavior between
compileandrunis a totally reasonable goal, for what it's worth! I just don't want to see +868 lines of code and riscv-specific logic and all this complexity to resolve it, is all. Thanks!
mvanhorn commented on PR #15022:
That's fair, and I agree on both points. Treating
riscv64andriscv64gcas the same ISA is the wrong direction, and the test file is far more than this needs.Looking at it again, the actual gap in
compileis small: when--targetis given,handle_modulebuilds the ISA from the command line only, so the file'ssetlines (hereenable_multi_ret_implicit_sret=true) are dropped. Passing--set enable_multi_ret_implicit_sret=trueon the command line already works around it.The smallest change I can see is: if the file has a
targetline whose triple matches--targetexactly, use that ISA from the file (which carries its flags), otherwise keep today's behavior. No architecture aliasing, and theriscv64vsriscv64gcmismatch onrunstays an error. That should be a few lines incompile.rsplus at most one filetest. Does that match what you had in mind, or would you rathercompilestay as is and this be documented as using--set?<!-- r:8a537d86c552.df328af3eee7 -->
Last updated: Oct 31 2026 at 23:03 UTC