saulecabrera opened PR #5419 from refactor-apply-params to main:
This commit allows retrieving a
MachBufferFinalized<Final>from aMachBufferFinalized<Stencil>without relying on
ir::FunctionParameters. Instead it uses the function's base source location, which is the only piece used by the previousapply_paramsdefinition.This change allows other uses cases (e.g. Winch) to use an opaque, common concept, exposed outside of
cranelift-codegento get the finalized state of the machine buffer. This change implies that Winch will transitively know about theStencilcompilation phase, but theStencilphase is not exposed to Winch.Other alternatives considered:
Parametrizing
MachBufferFinzalizedin a way such that it allows specifying which compilation phase the caller is targetting. Such approach would require also parametrizing theMachSrcLocdefinition. One of the main drawbacks of this approach is that it also requires changing how theMachBuffer'sstart_srclocworks: for caller requesting aFinalMachBufferFinalized, theMachBufferwill need to work in terms ofSourceLocrather than inRelSourceLocterms. This approach doesn't necessarily present more advantages than the approach presented in this change, in which there's no need to make any fundamental changes and in which all thecranelift-codegenprimitives are already exposed.<!--
Please ensure that the following steps are all taken care of before submitting
the PR.
[ ] This has been discussed in issue #..., or if not, please tell us why
here.[ ] A short description of what this does, why it is needed; if the
description becomes long, the matter should probably be discussed in an issue
first.[ ] This PR contains test cases, if meaningful.
- [ ] A reviewer from the core maintainer team has been assigned for this PR.
If you don't know who could review this, please indicate so. The list of
suggested reviewers on the right can help you.Please ensure all communication adheres to the code of conduct.
-->
saulecabrera requested cfallin for a review on PR #5419.
jameysharp submitted PR review.
cfallin submitted PR review.
bnjbvr submitted PR review.
saulecabrera merged PR #5419.
Last updated: Dec 13 2025 at 19:03 UTC