Chris Lattner
2012-Nov-22 16:24 UTC
[LLVMdev] [RFC] Passing Options to Different Parts of the Compiler Using Attributes
On Nov 19, 2012, at 1:49 PM, Eric Christopher <echristo at gmail.com> wrote:> > > Querying > -------- > > The attributes are attached to the function. It's therefore trivial to access > the attributes within the middle- and the back-ends. Here's an example of how > attributes are queried: > > Just had a thought, what about compile options that change alignment/layout/section placement of globals etc? For example the -G <num> option in gcc that the mips guys will want to support some day (there are probably better options but this was the first the came to mind).All of those can be directly represented in LLVM IR today, but if there were a good reason to, I can see extending attributes to work on globals someday. -Chris -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20121122/0e481f89/attachment.html>
Justin Holewinski
2012-Nov-22 16:53 UTC
[LLVMdev] [RFC] Passing Options to Different Parts of the Compiler Using Attributes
On Thu, Nov 22, 2012 at 11:24 AM, Chris Lattner <clattner at apple.com> wrote:> > On Nov 19, 2012, at 1:49 PM, Eric Christopher <echristo at gmail.com> wrote: > > > > Querying >> -------- >> >> The attributes are attached to the function. It's therefore trivial to >> access >> the attributes within the middle- and the back-ends. Here's an example of >> how >> attributes are queried: >> > > Just had a thought, what about compile options that change > alignment/layout/section placement of globals etc? For example the -G <num> > option in gcc that the mips guys will want to support some day (there are > probably better options but this was the first the came to mind). > > > All of those can be directly represented in LLVM IR today, but if there > were a good reason to, I can see extending attributes to work on globals > someday. >I'm a bit worried about this creating an arbitrary line between annotations that are defined as attributes and annotations that are first-class keywords in the IR language. It may become a source of confusion for people. If attributes are only applied to functions, the obvious questions for users is "why do I need to do things differently for functions vs. globals?" I'm not saying it's a big issue, but it does seem a bit inconsistent. If we're implementing these attributes anyway, why not unify the handling of annotations on functions and global variables?> > -Chris > > > _______________________________________________ > LLVM Developers mailing list > LLVMdev at cs.uiuc.edu http://llvm.cs.uiuc.edu > http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev > >-- Thanks, Justin Holewinski -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20121122/93557b08/attachment.html>
Chris Lattner
2012-Nov-22 17:05 UTC
[LLVMdev] [RFC] Passing Options to Different Parts of the Compiler Using Attributes
On Nov 22, 2012, at 8:53 AM, Justin Holewinski <justin.holewinski at gmail.com> wrote:> On Thu, Nov 22, 2012 at 11:24 AM, Chris Lattner <clattner at apple.com> wrote: > > On Nov 19, 2012, at 1:49 PM, Eric Christopher <echristo at gmail.com> wrote: > >> >> >> Querying >> -------- >> >> The attributes are attached to the function. It's therefore trivial to access >> the attributes within the middle- and the back-ends. Here's an example of how >> attributes are queried: >> >> Just had a thought, what about compile options that change alignment/layout/section placement of globals etc? For example the -G <num> option in gcc that the mips guys will want to support some day (there are probably better options but this was the first the came to mind). > > All of those can be directly represented in LLVM IR today, but if there were a good reason to, I can see extending attributes to work on globals someday. > > I'm a bit worried about this creating an arbitrary line between annotations that are defined as attributes and annotations that are first-class keywords in the IR language. It may become a source of confusion for people. If attributes are only applied to functions, the obvious questions for users is "why do I need to do things differently for functions vs. globals?" I'm not saying it's a big issue, but it does seem a bit inconsistent. If we're implementing these attributes anyway, why not unify the handling of annotations on functions and global variables?I'm not saying I'm opposed to it - I'm saying that it is a completely different topic than what Bill is proposing. -Chris -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20121122/10232439/attachment.html>
Eric Christopher
2012-Nov-22 20:07 UTC
[LLVMdev] [RFC] Passing Options to Different Parts of the Compiler Using Attributes
> > > Querying >> -------- >> >> The attributes are attached to the function. It's therefore trivial to >> access >> the attributes within the middle- and the back-ends. Here's an example of >> how >> attributes are queried: >> > > Just had a thought, what about compile options that change > alignment/layout/section placement of globals etc? For example the -G <num> > option in gcc that the mips guys will want to support some day (there are > probably better options but this was the first the came to mind). > > > All of those can be directly represented in LLVM IR today, but if there > were a good reason to, I can see extending attributes to work on globals > someday. > >Right, I couldn't think of anything that wasn't handled already, but I wasn't sure if we wanted this to be a single way of encapsulating information for globals. No opinion either way :) -eric -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20121122/75069dab/attachment.html>
Apparently Analagous Threads
- [LLVMdev] [RFC] Passing Options to Different Parts of the Compiler Using Attributes
- [LLVMdev] [RFC] Passing Options to Different Parts of the Compiler Using Attributes
- [LLVMdev] [RFC] Passing Options to Different Parts of the Compiler Using Attributes
- [LLVMdev] [RFC] Passing Options to Different Parts of the Compiler Using Attributes
- [LLVMdev] [RFC] Passing Options to Different Parts of the Compiler Using Attributes