[PATCH] D127115: [RFC][DAGCombine] Make sure combined nodes are added back to the worklist in topological order.

Sanjay Patel via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Sat Jul 16 06:54:25 PDT 2022


spatel added a comment.

In D127115#3656305 <https://reviews.llvm.org/D127115#3656305>, @barannikov88 wrote:

> @spatel 
> I'm facing an issue which might be related to the work you are doing.
> Suppose I have the following DAG:
> A -> B -> C -> D
> DAGCominer can optimize C -> D into E, and then A -> B -> E can be optimized further to just F.
>
> If C precedes A in the visit order, this is just fine. However, if A is visited first and then C -> D is combined into E, then A will not be revisited (because it is not immediate successor or predecessor of C), and the pattern A -> B -> E will not be matched.
> For this reason I have to match both A -> B -> C -> D and A -> B -> E. Will your patch help with this issue or is it something unrelated?

I'm not the author of this patch; I've just tried to reduce some of the regressions that are visible here.
But yes, I think this patch would help in situations like you describe. Can you apply the patch to confirm? (Without the test diffs, this is just a very small patch to DAGCombiner.)


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D127115/new/

https://reviews.llvm.org/D127115



More information about the llvm-commits mailing list