Uh oh!
There was an error while loading. Please reload this page.
Implement support for become and explicit tail call codegen for the LLVM backend - #144232
Conversation
rustbot
commented
Jul 20, 2025
rustbot
commented
Jul 20, 2025
Some changes occurred in compiler/rustc_codegen_gcc Some changes occurred in compiler/rustc_codegen_ssa |
6a6d3c2 to
f912c90Compare
This comment has been minimized.
This comment has been minimized.
b36cf15 to
ac87434Compare
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
138b2a7 to
3fac279Compare
This comment has been minimized.
This comment has been minimized.
jeffparsons
commented
Jul 21, 2025
I thought LLVM already supported the Wasm tail-call instructions — what's the missing piece that needs bikeshedding? |
oli-obk
commented
Jul 21, 2025
@rustbot author it seems a tailcall test is still hitting a stack overflow, do you know why? |
rustbot
commented
Jul 21, 2025
Reminder, once the PR becomes ready for a review, use |
Uh oh!
There was an error while loading. Please reload this page.
This was me mistakenly marking the rest |
xacrimon
commented
Jul 21, 2025
Ah, my knowledge is outdated then. I've edited my comment, though point still stands for backends that aren't llvm/gcc. |
xacrimon
commented
Jul 21, 2025
@rustbot ready |
xacrimon
commented
Jul 21, 2025
@WaffleLapkin I'm going to go ahead and guess this is something you want to have a look at. |
oli-obk
commented
Jul 22, 2025
@bors r+ Thanks! Glad we finally support it! |
bors
commented
Jul 22, 2025
WaffleLapkin
commented
Jul 30, 2025
Thanks! |
bors
commented
Jul 30, 2025
…fleLapkin Implement support for `become` and explicit tail call codegen for the LLVM backend This PR implements codegen of explicit tail calls via `become` in `rustc_codegen_ssa` and support within the LLVM backend. Completes a task on (rust-lang#112788). This PR implements all the necessary bits to make explicit tail calls usable, other backends have received stubs for now and will ICE if you use `become` on them. I suspect there is some bikeshedding to be done on how we should go about implementing this for other backends, but it should be relatively straightforward for GCC after this is merged. During development I also put together a POC bytecode VM based on tail call dispatch to test these changes out and analyze the codegen to make sure it generates expected assembly. That is available [here](https://github.com/xacrimon/tcvm).
Rollup of 6 pull requests Successful merges: - #135975 (Implement `push_mut`) - #143672 (Fix Box allocator drop elaboration) - #144232 (Implement support for `become` and explicit tail call codegen for the LLVM backend) - #144663 (coverage: Re-land "Enlarge empty spans during MIR instrumentation") - #144683 (Simplify library dependencies on `compiler-builtins`) - #144685 (Only extract lang items once in codegen_fn_attrs) r? `@ghost` `@rustbot` modify labels: rollup
Rollup of 6 pull requests Successful merges: - #135975 (Implement `push_mut`) - #143672 (Fix Box allocator drop elaboration) - #144232 (Implement support for `become` and explicit tail call codegen for the LLVM backend) - #144663 (coverage: Re-land "Enlarge empty spans during MIR instrumentation") - #144685 (Only extract lang items once in codegen_fn_attrs) - #144717 (Move `rustc_middle::parameterized`) r? `@ghost` `@rustbot` modify labels: rollup
Uh oh!
There was an error while loading. Please reload this page.
Rollup merge of #144232 - xacrimon:explicit-tail-call, r=WaffleLapkin Implement support for `become` and explicit tail call codegen for the LLVM backend This PR implements codegen of explicit tail calls via `become` in `rustc_codegen_ssa` and support within the LLVM backend. Completes a task on (#112788). This PR implements all the necessary bits to make explicit tail calls usable, other backends have received stubs for now and will ICE if you use `become` on them. I suspect there is some bikeshedding to be done on how we should go about implementing this for other backends, but it should be relatively straightforward for GCC after this is merged. During development I also put together a POC bytecode VM based on tail call dispatch to test these changes out and analyze the codegen to make sure it generates expected assembly. That is available [here](https://github.com/xacrimon/tcvm).
…ffleLapkin Additional tce tests r? `@oli-obk` Adds known-bug tests for LLVM emissions regarding indirect operands for TCE. Also includes a test, `indexer.rs`, referring to function_table behavior described by the RFC. Depends on rust-lang#144232Closesrust-lang#144293
…ffleLapkin Additional tce tests r? ``@oli-obk`` Adds known-bug tests for LLVM emissions regarding indirect operands for TCE. Also includes a test, `indexer.rs`, referring to function_table behavior described by the RFC. Depends on rust-lang#144232Closesrust-lang#144293
…fleLapkin Implement support for `become` and explicit tail call codegen for the LLVM backend This PR implements codegen of explicit tail calls via `become` in `rustc_codegen_ssa` and support within the LLVM backend. Completes a task on (rust-lang#112788). This PR implements all the necessary bits to make explicit tail calls usable, other backends have received stubs for now and will ICE if you use `become` on them. I suspect there is some bikeshedding to be done on how we should go about implementing this for other backends, but it should be relatively straightforward for GCC after this is merged. During development I also put together a POC bytecode VM based on tail call dispatch to test these changes out and analyze the codegen to make sure it generates expected assembly. That is available [here](https://github.com/xacrimon/tcvm).
…ffleLapkin Additional tce tests r? ``@oli-obk`` Adds known-bug tests for LLVM emissions regarding indirect operands for TCE. Also includes a test, `indexer.rs`, referring to function_table behavior described by the RFC. Depends on rust-lang#144232Closesrust-lang#144293
| True, | ||
| } | ||
| /// Indicates to the call terminator codegen whether a cal |
There was a problem hiding this comment.
The final word on the line is misspelled - should be call if I'm not mistaken.
EDIT: I see the PR is merged last week. I'm not that familiar with GitHub's UI these days. Sorry for causing noise on a merged PR.
…ffleLapkin,tgross35 Additional tce tests r? `@oli-obk` Adds known-bug tests for LLVM emissions regarding indirect operands for TCE. Also includes a test, `indexer.rs`, referring to function_table behavior described by the RFC. Depends on rust-lang#144232Closesrust-lang#144293
Rollup merge of #144650 - Borgerr:additional-tce-tests, r=WaffleLapkin,tgross35 Additional tce tests r? `@oli-obk` Adds known-bug tests for LLVM emissions regarding indirect operands for TCE. Also includes a test, `indexer.rs`, referring to function_table behavior described by the RFC. Depends on #144232Closes#144293
…n,tgross35 Additional tce tests r? `@oli-obk` Adds known-bug tests for LLVM emissions regarding indirect operands for TCE. Also includes a test, `indexer.rs`, referring to function_table behavior described by the RFC. Depends on rust-lang/rust#144232Closesrust-lang/rust#144293
…n,tgross35 Additional tce tests r? `@oli-obk` Adds known-bug tests for LLVM emissions regarding indirect operands for TCE. Also includes a test, `indexer.rs`, referring to function_table behavior described by the RFC. Depends on rust-lang/rust#144232Closesrust-lang/rust#144293
…n,tgross35 Additional tce tests r? `@oli-obk` Adds known-bug tests for LLVM emissions regarding indirect operands for TCE. Also includes a test, `indexer.rs`, referring to function_table behavior described by the RFC. Depends on rust-lang/rust#144232Closesrust-lang/rust#144293
Rollup of 6 pull requests Successful merges: - rust-lang/rust#135975 (Implement `push_mut`) - rust-lang/rust#143672 (Fix Box allocator drop elaboration) - rust-lang/rust#144232 (Implement support for `become` and explicit tail call codegen for the LLVM backend) - rust-lang/rust#144663 (coverage: Re-land "Enlarge empty spans during MIR instrumentation") - rust-lang/rust#144685 (Only extract lang items once in codegen_fn_attrs) - rust-lang/rust#144717 (Move `rustc_middle::parameterized`) r? `@ghost` `@rustbot` modify labels: rollup
…n,tgross35 Additional tce tests r? `@oli-obk` Adds known-bug tests for LLVM emissions regarding indirect operands for TCE. Also includes a test, `indexer.rs`, referring to function_table behavior described by the RFC. Depends on rust-lang/rust#144232Closesrust-lang/rust#144293
This PR implements codegen of explicit tail calls via
becomeinrustc_codegen_ssaand support within the LLVM backend. Completes a task on (#112788). This PR implements all the necessary bits to make explicit tail calls usable, other backends have received stubs for now and will ICE if you usebecomeon them. I suspect there is some bikeshedding to be done on how we should go about implementing this for other backends, but it should be relatively straightforward for GCC after this is merged.During development I also put together a POC bytecode VM based on tail call dispatch to test these changes out and analyze the codegen to make sure it generates expected assembly. That is available here.