<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=windows-1250">
<style type="text/css" style="display:none;"> P {margin-top:0;margin-bottom:0;} </style>
</head>
<body dir="ltr">
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
Hi Yonghae,</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
<br>
</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
Could you provide a short example for this? Perhaps using <a href="https://godbolt.org/" id="LPNoLP561218">
https://godbolt.org/</a><br>
</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
(there is now a "ARM 64-BIT CLANG" compilers section)</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
<br>
</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
I see some details about the frame pointer in:</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
llvm-project/llvm/lib/Target/AArch64/AArch64FrameLowering.cpp<br>
</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
<br>
</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
Though I haven't read it properly yet, it seems like it's not a simple case of not using it at all. It depends on circumstance.</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
<br>
</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
Thanks,</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
David Spickett.<br>
</div>
<div id="appendonsend"></div>
<hr style="display:inline-block;width:98%" tabindex="-1">
<div id="divRplyFwdMsg" dir="ltr"><font face="Calibri, sans-serif" style="font-size:11pt" color="#000000"><b>From:</b> llvm-dev <llvm-dev-bounces@lists.llvm.org> on behalf of Yonghae Kim via llvm-dev <llvm-dev@lists.llvm.org><br>
<b>Sent:</b> 27 February 2020 01:27<br>
<b>To:</b> llvm-dev@lists.llvm.org <llvm-dev@lists.llvm.org><br>
<b>Subject:</b> [llvm-dev] LLVM AArch64 backend using stack pointer to reference local variables</font>
<div> </div>
</div>
<div class="BodyFragment"><font size="2"><span style="font-size:11pt;">
<div class="PlainText">Hi all,<br>
<br>
I am wondering whether there is any way<br>
(i.e., compile option or different version of backend code that can be referred to)<br>
to make the LLVM AArch64 backend use the frame pointer instead of the stack pointer<br>
when it references (or locates) local variables in a stack frame.<br>
<br>
When I generate assembly code using LLVM AArch64 backend,<br>
it seems to use a stack pointer to locate the local variables in a stack frame.<br>
<br>
For example,<br>
  ....<br>
  str wzr, [sp, #12]    // e.g., local variable a<br>
  str w8, [sp, #8]      // e.g., local variable b<br>
  str w9, [sp, #4]      // e.g., local variable c<br>
  str w10, [sp]<br>
  …<br>
<br>
(It calculates offsets from a stack pointer and accesses the local variable using the stack pointer and the offsets.)<br>
<br>
The weird thing is all the other compiler tools are using a frame pointer rather than a stack pointer.<br>
I tried out "gcc", "clang", "LLVM x86 backend" and they are all referencing local variables using a frame pointer and its offsets.<br>
<br>
Is there any reasons that the only LLVM AArch64 uses a stack pointer?<br>
And, is there any way to make it use a frame pinter?<br>
<br>
I'd really appreciate for any comment or answer! :)<br>
<br>
Regards,<br>
Yonghae<br>
_______________________________________________<br>
LLVM Developers mailing list<br>
llvm-dev@lists.llvm.org<br>
<a href="https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev">https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev</a><br>
</div>
</span></font></div>
</body>
</html>