[LLVMdev] Re: Newbie questions

Archie Cobbs archie at dellroad.org
Wed Apr 26 14:53:31 PDT 2006


Chris Lattner wrote:
> On Wed, 26 Apr 2006, Archie Cobbs wrote:
>>>> With no annotation support, it doesn't seem like you can. This is
>>>> the problem. I'm not saying annotations are good, just that they
>>>> represent one (sub-optimal) solution to the problem. Without them,
>>>> we have zero solutions to the problem.
>>>
>>> Why do you believe this?
>>
>> Sorry, that sounded more pessimistic that it was supposed to.
>>
>> What I meant was, there are probably better solutions out there,
>> but they haven't been implemented yet and it will take some work
>> (both defining them and coding them) to get there. At least, that's
>> what I think I've heard so far (don't forget I'm the "newbie" here :-)
> 
> I still don't follow.  Having annotations on the IR is *exactly* 
> equivalant to having a map from IR objects to the things you want to 
> annotate them with.
> 
> Why isn't this just as acceptable (and problematic) as annotations?

Perhaps it is. In which case, I guess we need something better or else
we'll never be able to do certain optimizations. Or, if something better
doesn't exist, then we'll have to figure out how to eliminate or
workaround the problems that annotations have.

I.e., maybe annotations are bringing up exactly the right issues,
and by discarding them we're just shooting the messenger...

For example (I'm making this up, you may have already considered and
rejected it): you could have a callback function (supplied by the
front end) that would be invoked any time an optimization pass needed
to {add, delete, move, modify} an LLVM instruction. In other words,
all the questions about "what to do with the annotation in situation X"
you simply delegate to the front end to deal with. So then you no longer
have to worry about what happens to the annotations during a transformation.

OK I'll shut up now and go read about annotation in the archives... :-)

-Archie

__________________________________________________________________________
Archie Cobbs      *        CTO, Awarix        *      http://www.awarix.com




More information about the llvm-dev mailing list