[PATCH] [SLSR] simplify ternary adds by reassociation

Chandler Carruth chandlerc at google.com
Wed Apr 8 20:08:51 PDT 2015


Minor aside -- not sure it really is that relevant to this specific concern:

On Wed, Apr 8, 2015 at 1:47 PM Jingyue Wu <jingyue at google.com> wrote:
>
> 2. -reassociate happens too early. Many opportunities I discovered are
> exposed after loop unrolling, but -reassociate happens before loop
> unrolling.
>

I think this is a bug. We should absolutely be running this pass (and
potentially others) after loop unrolling.


>
> Jingyue
>
> On Wed, Apr 8, 2015 at 1:23 PM Sanjoy Das <sanjoy at playingwithpointers.com>
> wrote:
>
>> Should this rule live inside `-reassociate`?  Optimizing
>>
>>    define void @reassociate(i32 %a, i32 %b, i32 %c) {
>>     %1 = add i32 %a, %c
>>     call void @foo(i32 %1)
>>     %2 = add i32 %a, %b
>>     %3 = add i32 %2, %c
>>     call void @foo(i32 %3)
>>     ret void
>>   }
>>
>> to
>>
>>    define void @reassociate(i32 %a, i32 %b, i32 %c) {
>>     %1 = add i32 %a, %c
>>     call void @foo(i32 %1)
>>     %3 = add i32 %1, %b
>>     call void @foo(i32 %3)
>>     ret void
>>   }
>>
>> looks like a generally good idea to me.
>>
>>
>> http://reviews.llvm.org/D8898
>>
>> EMAIL PREFERENCES
>>   http://reviews.llvm.org/settings/panel/emailpreferences/
>>
>>
>>  _______________________________________________
> llvm-commits mailing list
> llvm-commits at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20150409/50e0c45a/attachment.html>


More information about the llvm-commits mailing list