[LLVMdev] Memory Subsystem Representation

Chris Lattner clattner at apple.com
Tue May 3 17:17:45 PDT 2011


On May 3, 2011, at 12:01 PM, David A. Greene wrote:

> "Rotem, Nadav" <nadav.rotem at intel.com> writes:
> 
>> Can you describe which passes may benefit from this information ?  My
>> intuition is that until there are a number of passes which require
>> this information, there are other ways to provide this
>> information. One way would be to use Metadata.
> 
> We have Cray-specific passes that use this information.  Some of the
> stuff Polly is doing almost certainly would benefit.

This sounds like an interesting addition, but we don't just speculatively add analysis passes to LLVM.  Doing so leads to overdesign and lack of purpose.  I'd suggest designing and implementing a specific loop optimization pass, hard coding it to a specific target, then generalize it by adding a way to get target parameters.  This is how LSR was built, for example, which drove the address mode selection stuff.

> Metadata seems a very clunky way to do this.  It is so target-specific
> that it would render IR files completely target-dependent.  These are
> rather complex structures we're talking about.  Encoding it in metadata
> would be inconvenient.

I agree that metadata isn't the right way to go, but this argument doesn't fly at all with me.  The whole point of these passes are to do target-specific optimizations.

The right way to expose this sort of thing is with the new TargetRegistry interfaces.  That said, speculatively adding target hooks isn't the right way to go, the client should come first.

-Chris



More information about the llvm-dev mailing list