[LLVMdev] Optimization passes organization and tradeoffs

Nicolas Capens nicolas at capens.net
Wed May 21 03:03:09 PDT 2008


Hi Daniel,

What's a constant folder? I only found a reference to it in the SCCP
implementation. Is there a bit of documentation for it or could you explain
the basics?

Thanks,

Nicolas


-----Original Message-----
From: llvmdev-bounces at cs.uiuc.edu [mailto:llvmdev-bounces at cs.uiuc.edu] On
Behalf Of Daniel Berlin
Sent: Tuesday, 20 May, 2008 20:34
To: LLVM Developers Mailing List
Subject: Re: [LLVMdev] Optimization passes organization and tradeoffs

On Tue, May 20, 2008 at 2:28 PM, Chris Lattner <clattner at apple.com> wrote:
>
> On May 20, 2008, at 8:57 AM, David Greene wrote:
>
>> On Tuesday 20 May 2008 07:03, Nicolas Capens wrote:
>>
>>> 1) Does ScalarReplAggregates totally superscede
>>> PromoteMemoryToRegister? I
>>
>> Nope, they are different.  Mem2Reg is really important if you want
>> register
>> allocation.
>
> Actually SROA does fully subsume Mem2Reg. It iterates between breaking
> up aggregates and promoting them to registers.
>
>>> think I need it to optimize small arrays, but what is the expected
>>> added
>>> complexity?
>>
>> I shouldn't think it would be very expensive at all.
>
> Agreed.
>
>>> 2) Does SCCP also eliminate multiplying/dividing by 1 and
>>> adding/subtracting 0?
>>
>> That's probably more the purview of instcombine.
>
> Right.


SCCP with a good constant folder should definitely be able to take
care of * 0 and */ 1 though.

Not that i would go much further than this.
_______________________________________________
LLVM Developers mailing list
LLVMdev at cs.uiuc.edu         http://llvm.cs.uiuc.edu
http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev




More information about the llvm-dev mailing list