[PATCH] D102342: [SPARC] Fix register reuse in leaf function remapping step
Daniel Cederman via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Tue Oct 19 04:48:09 PDT 2021
dcederman added a comment.
In D102342#3069943 <https://reviews.llvm.org/D102342#3069943>, @koakuma wrote:
> In D102342#3060935 <https://reviews.llvm.org/D102342#3060935>, @dcederman wrote:
>
>> Hello!
>>
>> It seems that this patch contains a rewrite of the remapRegsForLeafProc() function in addition to the new check described in the summary. Could you split it up into two patches, one with the rewrite and one with the added check?
>
> I'm not sure about this. The way I see it is that the checks need to be done together with the rewrite, so it probably cannot be split like that (?)
The only functional change I can see is the check at line 345-348, and that should be in SparcFrameLowering::isLeafProc(). Then you do not need to rewrite determineCalleeSaves(). Or is there some functional change that I'm missing?
isLeafProc() checks if %L0 is used to determine if any of the %L or %O registers are used since the %I registers are allocated first. But it breaks if inline assembly code uses any of %L or %O. I ran into this bug before and fixed it by adding some code in tryInlineAsm() to mark the function as ineligible for leaf optimization if any of the %L or %O registers were used. So that is an alternative approach. But this approach is fine be me, but the check should be in isLeafProc().
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D102342/new/
https://reviews.llvm.org/D102342
More information about the llvm-commits
mailing list