This is an archive of the discontinued LLVM Phabricator instance.

[DAG] Bound loop dependence check in merge optimization.
ClosedPublic

Authored by niravd on Aug 28 2017, 10:08 AM.

Details

Summary

The loop dependence check looks for dependencies between store merge
candidates not captured by the chain sub-DAG doing a check of
predecessors which may be very large. Conservatively bound number of
nodes checked for compilation time. (Resolves PR34326).

Diff Detail

Repository
rL LLVM

Event Timeline

niravd created this revision.Aug 28 2017, 10:08 AM
efriedma edited edge metadata.Aug 28 2017, 12:24 PM
efriedma added a subscriber: chandlerc.

I guess this is okay...? Adding arbitrary limits isn't nice, but I don't know what a nice solution looks like here. (Probably we should be using a different algorithm to find stores to merge; maybe something more like a DAG scheduling algorithm.)

lib/CodeGen/SelectionDAG/DAGCombiner.cpp
12795 ↗(On Diff #112912)

This helps in cases where there's a common ancestor nearby... but does that actually cover all interesting cases?

hans added a subscriber: hans.Aug 29 2017, 9:46 AM

Based on Dimitry's comment in https://bugs.llvm.org/show_bug.cgi?id=34326#c13 this seems to solve the problem. Can we get it landed so it can be part of 5.0.0?

hans added a reviewer: dim.Aug 29 2017, 10:07 AM

I'm not sure if Nirav is around.

Eli: do you think this is ok for landing? It seems to fix the issue in the PR and is probably the final thing we need for 5.0.0.

This revision was automatically updated to reflect the committed changes.
hans added a comment.Aug 29 2017, 11:42 AM

I've gone ahead and committed this to unblock the release.