[llvm-commits] [PATCH, PowerPC] Split Darwin and 64-bit SVR4 processing of LowerFormalArguments

William J. Schmidt wschmidt at linux.vnet.ibm.com
Fri Oct 5 14:44:18 PDT 2012



On Fri, 2012-10-05 at 16:41 -0500, William J. Schmidt wrote:
> 
> On Fri, 2012-10-05 at 14:29 -0700, Chandler Carruth wrote:
> > On Fri, Oct 5, 2012 at 2:25 PM, Hal Finkel <hfinkel at anl.gov> wrote:
> >         
> >         
> >         ----- Original Message -----
> >         > From: "William J. Schmidt" <wschmidt at linux.vnet.ibm.com>
> >         > To: llvm-commits at cs.uiuc.edu
> >         > Sent: Friday, October 5, 2012 4:20:53 PM
> >         > Subject: [llvm-commits] [PATCH, PowerPC] Split Darwin and
> >         64-bit SVR4 processing of LowerFormalArguments
> >         >
> >         > The attached patch is some TLC to split apart a function
> >         being used
> >         > by
> >         > both Darwin and 64-bit SVR4 ABIs.  There is no change in
> >         function.  I
> >         > have plans to make some nontrivial changes to the SVR4 ABI
> >         handling,
> >         > and
> >         > having the two ABIs separated will be better for all
> >         concerned.
> >         >
> >         > Tested with no new regressions.  Ok to commit?
> >         
> >         
> >         Alright (I assume the large block is copied from the Darwin
> >         version), LGTM.
> > 
> > 
> > Maybe I'm just confused, but why is it OK to copy/paste so much code
> > from Darwin? IS the code going away as you refactor it, or is there
> > actually a need to build an abstraction shared between the two?
> > 
> > 
> > (I may just not understand the end goal of the patch, in which case a
> > better explanation will fix matters...)
> >  
> 
> I do have plans to refactor some of the code.  The fact is that the SVR4
> ABI has requirements that Darwin doesn't have, and littering the code
> with "this part is for Darwin, this part is for SVR4" is going to get
> unworkable pretty fast.
> 
> An example of what's missing:  64-bit SVR4 requires that a callee that
> takes the address of any parameter must copy any parameters passed in
> registers into the caller's stack frame at certain reserved locations.
> Because of how the code is structured, that's going to require some
> rip-up of the ordering of events.  Rather than worrying all the time
> about breaking the Darwin ABI, I want to separate the two now before
> things become too messy.
> 
> There are several other deficiencies in parameter passing for which I've
> opened a number of bug reports, many of which need to be solved in this
> same code.
> 
> This patch is just to tease the two apart in the most straightforward
> way possible.  Factoring will be done as part of the upcoming work.
> 
> Hope this helps!

I also meant to point out that the code is not just copied.  The 64-bit
SVR4 version of the code is significantly smaller, because all the
Darwin logic for its 32-bit ABI is not germane and was removed.

Bill

> 
> Bill
> >         
> >          -Hal
> >         
> >         >
> >         > Thanks,
> >         > Bill
> >         > --
> >         > Bill Schmidt, Ph.D.
> >         > IBM Advance Toolchain for PowerLinux
> >         > IBM Linux Technology Center
> >         > wschmidt at us.ibm.com
> >         > wschmidt at linux.vnet.ibm.com
> >         >
> >         >
> >         >
> >         >
> >         >
> >         >
> >         
> >         > _______________________________________________
> >         > llvm-commits mailing list
> >         > llvm-commits at cs.uiuc.edu
> >         > http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
> >         >
> >         
> >         --
> >         Hal Finkel
> >         Postdoctoral Appointee
> >         Leadership Computing Facility
> >         Argonne National Laboratory
> >         _______________________________________________
> >         llvm-commits mailing list
> >         llvm-commits at cs.uiuc.edu
> >         http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
> > 
> > 




More information about the llvm-commits mailing list