[LLVMdev] loop fusion

Dan Gohman gohman at apple.com
Thu Sep 9 17:47:39 PDT 2010


On Sep 8, 2010, at 12:13 PM, Renato Golin wrote:

> On 8 September 2010 18:21, Devang Patel <dpatel at apple.com> wrote:
>> Andrew,
>> 
>> There is not any transformation in LLVM that does loop fusion. I do not of anyone who is working on this. If you're interested to work on it then it'd be great!
> 
> Hi Devang,
> 
> Do you know if any pass is taking metadata to avoid un-optimizing?

Not yet, but it would be valid.

> Loop fusion can make it worse if you have strong locality (two
> completely separate big memory access) in terms of cache miss in
> small-memory platforms.

Agreed. And it can compound register pressure and oversubscribe other
execution resources. A general-purpose loop fusion pass should
consider such things.

> So, would be good if the front-end could pass
> on some information down the codegen?

Perhaps, although most front-ends don't have the kind of information
that a loop fusion pass would need, unless you're going to venture
into pragma territory.

> That could also help
> implementing union types...

I don't see the connection here.

> I know it's not good to depend on metadata (as for unions), but it
> could help some architectures to generate better code, rather than
> just "correct" code.

The main constraint on metadata is that it can't be necessary for
correctness.

Dan





More information about the llvm-dev mailing list