<table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Issue</th>
<td>
<a href=https://github.com/llvm/llvm-project/issues/91790>91790</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>
Improve stack handling for RISC-V Machine outlinerThis is a work item identified in the gap analysis done in #89822.
</td>
</tr>
<tr>
<th>Labels</th>
<td>
backend:RISC-V,
llvm:codegen,
llvm:codesize
</td>
</tr>
<tr>
<th>Assignees</th>
<td>
</td>
</tr>
<tr>
<th>Reporter</th>
<td>
ilovepi
</td>
</tr>
</table>
<pre>
This is a work item identified in the gap analysis done in https://github.com/llvm/llvm-project/issues/89822.
Stack frame handling, seems to be much more involved in the Arm outliners, with many routines and heuristics trying to optimize and maximize outlining opportunities.
First, there are several routines dealing w/ both stack transformations and analysis to help identify outlining candidates and in some cases fix up the outlining call site (e.g. copying from 1 register to another or adjusting offsets after outlining). Some of these tasks, like fixing up offsets are already handled for RISC-V or in the generic CodeGen bits. However, ARM targets do significantly more, and do more to ensure the outlined calls can be tail-called whenever possible.
I'll follow up w/ more details soon, after a more thorogh review of what is required for RISC-V.
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJykVD2T4zYM_TV0g1mPRVm3VqHC2R0nW1xzm0lPiZCEW4pQCMg-36_PUN6vm0mVNLZEgXgPDw9wIjRExMZUv5nqceMWHTk1FPiMM21a9tfmz5EESMDBhdMLkOIE5DEq9YQeKIKOCIObwUUXrkICniPmD6PqLKY8Gnsy9jSQjku77Xgy9hTC-e3vbk78HTs19kQiC4qxp0N9sHZrdo9md7z9PqvrXqBPbkIYXfSB4mDsAwjiJKAMLcK0dCNMnDL4mcP5g94xTcCLBoqYJF-7kI4wuXiFxItSRAEXPYy4JBKlTkDTleKQM_OsNNFPXCMm9-P2ckuXQ3ieOekSSQllC59ZnyiJZjwdMSG4hCB4xuTCB65Hl4uBi7EnaFlHkLVWTS5Kz2lyShxv_N4lVoYRw_zWiesnOp2LnrzT15IogvCE0DlBgZ5-wDKvmny-EQIIKYKxB9wOW-h4XqvvE09QQMKBRDFlWBc5FwOcwPnvi-gqQd8LqoDrc9R7ZmPrLTxndO4zpiCok5e1A4FeMNPJ15f5I0OWKSR0_nrrM3roOcG3p-eHu78y6pvjMGKiDh7Y4-8YoSWVLfzBl6xvBjh--wrq0pCzeobsdOqpc1HDdXVJDsoKeb6ZRhkwypKf3uVBv6ojWdVsMXUU7vIJeriMGDMYzCxCbcBfDPtk7H0I0HMIfMkVrv1dgTzmNALCHFcSq2rulcXIiYcREp4JL1m4y-g0T2DCvxdKv-jxirjxTenrsnYbbIr7oiq_VIe63IzNvsR9i53dezzUrd0VdeeLqt6XvbN1WRUbauzO7ndVsSsOZVGWW3twlXVfDs7aoqv6yux3ODkK2zyqW07DZh3Spi7u690muBaDrOvD2tZ1Lxi9KY83csZaYx-Mteuwl8eOPQ4Y_-1Y6Cfm8-pxk5p1KbTLIGa_CyQqH9hKGrB5mubEZ3ydk7dt8NkmX103UnxvYvofS8zY8raNNksKzX9faatg_wQAAP__EjvdLw">