[llvm] [llvm] Support multiple save/restore points in mir (PR #119357)
Philip Reames via llvm-commits
llvm-commits at lists.llvm.org
Thu Jul 31 11:13:08 PDT 2025
https://github.com/preames commented:
A couple of suggestions on how to move this forward. This is premised on the fact that we have general agreement on the direction, we're just splitting the code apart for ease of review.
Please split the review - in particular, remove all the target specific lowering and prolog epilogue into their own individual reviews. This change should *only* introduce the ability to round trip the new MIR format. Its fine to have client code *assert* there's only one save/restore point when exercised for the moment, and most of the API changes can be deferred to future patches.
In fact, the smallest possible change might be a parser/printer change which changes the MIR textual representation, but *doesn't* actually change the internal ability to represent more than one save/restore point. All the existing tests and code paths work with one point, you can wrap that into the textual parsing for the array syntax, and it should only be a few dozen lines of code + some test updates.
Another possible split point in the patch is splitting the notion of multiple save/restore points (with the same set of CSRs) from being able to split a different set of CSRs in each point. This would require the notion of multiple *points* but would not require any the logic for tracking individual registers.
https://github.com/llvm/llvm-project/pull/119357
More information about the llvm-commits
mailing list