[VM] Fix ref ownership in branch remaps - #24781
Open
zhangpan2001 wants to merge 1 commit into
Open
Conversation
Branch remaps selected MOVE using `isLastRealValueUse`, whose result accounts for uses across all successors. A use on one successor therefore prevented ownership transfer on another mutually exclusive successor, leaving an extra owning reference on the taken path. Use target-block liveness to select MOVE independently for each successor. If one occurrence of a repeated operand is coalesced with its destination, prevent the other remaps from using MOVE; otherwise a MOVE would clear the coalesced register. Add register allocation tests for both cases and an LLVM CPU end-to-end regression that executes both selector paths with indirect command buffers disabled. Fixes iree-org#24753 Co-authored-by: OpenAI <noreply@openai.com> Signed-off-by: zhangpan <98025960+zhangpan2001@users.noreply.github.com>
zhangpan2001
force-pushed
the
fix/24753-null-buffer-control-flow
branch
from
August 7, 2026 02:37
cc4d43f to
6878b03
Compare
Contributor
|
need to take a closer look, at first glance this seems eerily close to #24841 |
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.
Branch remaps selected MOVE using
isLastRealValueUse, whose result accounts for uses across all successors. A use on one successor therefore prevented ownership transfer on another mutually exclusive successor, leaving an extra owning reference on the taken path.Use target-block liveness to select MOVE independently for each successor. If one occurrence of a repeated operand is coalesced with its destination, prevent the other remaps from using MOVE; otherwise a MOVE would clear the coalesced register.
Add register allocation tests for both cases and an LLVM CPU end-to-end regression that executes both selector paths with indirect command buffers disabled.
Fixes #24753