[RISCV] Extend InstSeq (used in constant mat) to support multiple live regs #67159
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.
Posted mostly for discussion. This turned out to be more invasive and fiddly than I'd expected when I first started. My guess is that we probably won't land this, but I wanted to show what the option looked like.
This moves the logic for constant materialization with an additional vreg into common code. It does so by extending the InstSeq construct to support multiple live values in the sequence. This converts an InstSeq from being a linear chain of instructions to being a DAG of instructions.
Note that the emergency-slot.mir test change is in principle a bug fix; we're setting kill flags on a register which has later usage. Its probably an uninteresting bug in practice since it only happens on X0 which is a constant physreg and thus the kill flag is fairly meaningless.