[cfe-dev] stack-less model on small devices (patch)

Alireza.Moshtaghi at microchip.com Alireza.Moshtaghi at microchip.com
Wed Apr 30 11:31:38 PDT 2008


I created the patch for my target specific modifications and sent it to
cfe-commits. Since this is my first time to send a patch I don't know if
I have submitted my changes to the right place or not and of course what
is the turnaround time.
I also have attached it to this email just in case.
Please let me know if I have to do it differently.

Thanks
Ali

-----Original Message-----
From: Chris Lattner [mailto:clattner at apple.com] 
Sent: Thursday, April 24, 2008 9:46 AM
To: Alireza Moshtaghi - C13012
Cc: cfe-dev at cs.uiuc.edu
Subject: Re: [cfe-dev] stack-less model on small devices

On Apr 23, 2008, at 4:25 PM, Alireza.Moshtaghi at microchip.com wrote:
> Let me summarize...
> (patches)
> Ok, that makes sense to have the patches applied by someone else,
> however, my patches will surely break other peoples work. I'm just
> curious, how are you going to merge them? Conditional compiling?
> Commandline flags?

The best way to do this is to add a target to clang for your  
architecture, and conditionalize the codegen aspects on your target  
being active.  This means you'll be able to compile with 'clang t.c - 
arch myarch'.

> (alloca)
> We tried code generation in llvm by replacing alloca with global
> addresses however, (1) the name of local variable is not as easily
> available, (2)I don't feel quite comfortable with having the storage
> class of variable change at the last phase of translation. It sounds
> more reasonable to get it right in the front-end to begin with.

Using global variables should work reasonably well.  Just make sure  
they are marked as 'internal'.  The 'globalopt' pass will do SROA and  
other optimizations on them to help eliminate them.  I imagine that  
there are improvements we could also make, but there is nothing "in  
principle" that would prevent this from working.

-Chris
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: patch-svn.txt
URL: <http://lists.llvm.org/pipermail/cfe-dev/attachments/20080430/a13580bd/attachment.txt>


More information about the cfe-dev mailing list