[PATCH] D32563: Improve code placement algorithm in Reassociate pass.

Xinliang David Li via llvm-commits llvm-commits at lists.llvm.org
Thu Apr 27 16:02:32 PDT 2017


On Thu, Apr 27, 2017 at 2:38 PM, Daniel Berlin <dberlin at dberlin.org> wrote:

>
>
> On Thu, Apr 27, 2017 at 1:42 PM, Wei Mi via llvm-commits <
> llvm-commits at lists.llvm.org> wrote:
>
>> On Thu, Apr 27, 2017 at 1:26 PM, Daniel Berlin via Phabricator
>> <reviews at reviews.llvm.org> wrote:
>> > dberlin added a comment.
>> >
>> > Isn't this close to what n-ary reassociate does?
>> > (if so, why not just use that and disable this?)
>> >
>>
>> Nary reassociate tries to maximize the redundency exposed by
>> reassociation.
>
>
> As does reassociate :)
>
>
>> This patch tries to reduce the register pressure by
>> changing where to insert the intermediate results of reassociation,
>> and it doesn't try to improve the result of reassociation for better
>> CSE/PRE/LICM optimizations.
>
>
> I understand.
>
>
>> The two have different motivations, so I
>> don't see how nary reassociation can be helpful here.
>>
>
> The placement algorithm for computations that n-ary reassociate uses tries
> to reuse existing computation points.
> This patch tries to fix  "too many overlapped life-ranges. "
>
> The algorithm it uses, to find nearest common dominator of operands, etc,
> is pretty much what n-ary reassociate does:
> "
>   // Look for the closest dominator LHS of I that computes LHSExpr, and
> replace
>   // I with LHS op RHS.
> "
>
>

It seems to me that this may not necessarily result in reduced overlapping
live ranges -- it  can increase the live range of the temporary that holds
the value of LHS.  What this patch, on the other hand, can almost always
result in non-increased register pressure.

David


>
>
>
>> >
>> > https://reviews.llvm.org/D32563
>> >
>> >
>> >
>> _______________________________________________
>> llvm-commits mailing list
>> llvm-commits at lists.llvm.org
>> http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-commits
>>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20170427/9aa1d9f7/attachment.html>


More information about the llvm-commits mailing list