Rodolphe Suescun
2014-May-14 11:05 UTC
[LLVMdev] Question about calling convention implementation in LLVM target
Hi, We are currently developing an LLVM target for a micro-controller, and would like our TargetLowering::LowerCall method to emit PUSH instructions (instead of STORE) to pass arguments (which would improve code density for function calls). Is there a way of keeping track of the stack pointer changes implied by the PUSH instruction to calculate the correct offsets in RegisterInfo::eliminateFrameIndex when the call sequence is generated ? Thanks a lot in advance, Rod
Reid Kleckner
2014-May-14 16:53 UTC
[LLVMdev] Question about calling convention implementation in LLVM target
To my knowledge, this is an open project. It would also really help with x86_32 codegen, but people care less and less about that as time goes on. On Wed, May 14, 2014 at 4:05 AM, Rodolphe Suescun <rsu.medal at dolphin.fr>wrote:> Hi, > > We are currently developing an LLVM target for a micro-controller, > and would like our TargetLowering::LowerCall method to emit > PUSH instructions (instead of STORE) to pass arguments (which > would improve code density for function calls). > > Is there a way of keeping track of the stack pointer changes > implied by the PUSH instruction to calculate the correct > offsets in RegisterInfo::eliminateFrameIndex when the call > sequence is generated ? > > Thanks a lot in advance, > Rod > _______________________________________________ > LLVM Developers mailing list > LLVMdev at cs.uiuc.edu http://llvm.cs.uiuc.edu > http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev >-------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20140514/317cb70c/attachment.html>
Jim Grosbach
2014-May-15 00:09 UTC
[LLVMdev] Question about calling convention implementation in LLVM target
In theory, the SPAdj (stack pointer adjustment) tracking in PEI could be used to support something like this. That’s not how it’s used right now and it might get more than a little interesting implementing that, though. -Jim On May 14, 2014, at 4:05 AM, Rodolphe Suescun <rsu.medal at dolphin.fr> wrote:> Hi, > > We are currently developing an LLVM target for a micro-controller, > and would like our TargetLowering::LowerCall method to emit > PUSH instructions (instead of STORE) to pass arguments (which > would improve code density for function calls). > > Is there a way of keeping track of the stack pointer changes > implied by the PUSH instruction to calculate the correct > offsets in RegisterInfo::eliminateFrameIndex when the call > sequence is generated ? > > Thanks a lot in advance, > Rod > _______________________________________________ > LLVM Developers mailing list > LLVMdev at cs.uiuc.edu http://llvm.cs.uiuc.edu > http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev
Herbie Robinson
2014-May-17 21:52 UTC
[LLVMdev] Question about calling convention implementation in LLVM target
Also, push and pop operations are slower on some architectures (I believe the x86_32 is one of them). Smaller instructions are not always faster. On 5/14/14 12:53 PM, Reid Kleckner wrote:> To my knowledge, this is an open project. It would also really help > with x86_32 codegen, but people care less and less about that as time > goes on. > > > On Wed, May 14, 2014 at 4:05 AM, Rodolphe Suescun > <rsu.medal at dolphin.fr <mailto:rsu.medal at dolphin.fr>> wrote: > > Hi, > > We are currently developing an LLVM target for a micro-controller, > and would like our TargetLowering::LowerCall method to emit > PUSH instructions (instead of STORE) to pass arguments (which > would improve code density for function calls). > > Is there a way of keeping track of the stack pointer changes > implied by the PUSH instruction to calculate the correct > offsets in RegisterInfo::eliminateFrameIndex when the call > sequence is generated ? > > Thanks a lot in advance, > Rod > _______________________________________________ > LLVM Developers mailing list > LLVMdev at cs.uiuc.edu <mailto:LLVMdev at cs.uiuc.edu> > http://llvm.cs.uiuc.edu > http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev > > > > > _______________________________________________ > LLVM Developers mailing list > LLVMdev at cs.uiuc.edu http://llvm.cs.uiuc.edu > http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev-------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20140517/811c5bf3/attachment.html>
Rodolphe Suescun
2014-May-21 13:25 UTC
[LLVMdev] Question about calling convention implementation in LLVM target
Hi, Thanks for your answers. Le 15/05/2014 02:09, Jim Grosbach a écrit :> In theory, the SPAdj (stack pointer adjustment) tracking in PEI> could be used to support something like this. That’s not how it’s> used right now and it might get more than a little interesting > implementing that, though.We didn't manage to get this working and decided to use offsets relative to the frame pointer (instead of stack pointer) so PUSH instructions don't affect them. Le 17/05/2014 23:52, Herbie Robinson a écrit :> Also, push and pop operations are slower on some architectures (I > believe the x86_32 is one of them). Smaller instructions are not > always faster.Code density (which is as important as speed for us) will be better and speed will approximately be the same (might be a bit slower in some specific cases). Rod>> We are currently developing an LLVM target for a micro-controller, >> and would like our TargetLowering::LowerCall method to emit >> PUSH instructions (instead of STORE) to pass arguments (which >> would improve code density for function calls). >> >> Is there a way of keeping track of the stack pointer changes >> implied by the PUSH instruction to calculate the correct >> offsets in RegisterInfo::eliminateFrameIndex when the call >> sequence is generated ? >> >> Thanks a lot in advance, >> Rod >> _______________________________________________ >> LLVM Developers mailing list >> LLVMdev at cs.uiuc.edu http://llvm.cs.uiuc.edu >> http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev > >