[PATCH] D15537: limit the number of instructions per block examined by dead store elimination

Xinliang David Li via llvm-commits llvm-commits at lists.llvm.org
Mon Aug 22 12:24:11 PDT 2016


On Mon, Aug 22, 2016 at 11:28 AM, Daniel Berlin <dberlin at dberlin.org> wrote:
> +philip because he expressed concerns around limiting
>
> +eli
>
> Eli, i think your patch to DSE to do exact may-throw tracking is what made
> this worse.
>
> https://llvm.org/bugs/show_bug.cgi?id=29064
>
> I'm not sure we should limit DSE.

DSE is already limited in the current implementation -- except that
the 'limit' implementation is flawed -- it does not curb the N^2
behavior.  It limits the backward scanning from the current scanStart
location to 100 instructions. If it hits the limit, the processing of
current store instruction is over. However it finds an aliased store
before the limit is reached, it will continue walking backward from
the new scanning point. The complexity of the scan is O(N^2) where N
is the size of BB.

This patch can be considered as a bug fix to the existing limit impl.
With this patch, the total number scans per BB is limited at 100*N
where N is the size of BB.

Though we have a longer term plan (MemSSA), eliminating N^2 behavior
in optimizer is something desirable to do.

David

>
> I have an analysis pass just about ready to do the EBB/maythrow stuff, which
> gives "some" may-throw tracking, just not as exact as is being done here.
> Rather than limit DSE, i think we should revert the more-exact tracking for
> now unless we can show it produces significant perf improvements.
>
> Thoughts?
>
>
>
> On Mon, Aug 22, 2016 at 10:59 AM, David Li <davidxl at google.com> wrote:
>>
>> davidxl added a comment.
>>
>> The patch fixes the issue in https://llvm.org/bugs/show_bug.cgi?id=29064
>>
>>
>> https://reviews.llvm.org/D15537
>>
>>
>>
>


More information about the llvm-commits mailing list