[DAG] Prune cycle check in store merge.
ClosedPublic

Authored by niravd on May 16 2018, 8:37 AM.

Details

Summary

As part of merging stores we check that fusing the nodes does not
cause a cycle due to one candidate store being indirectly dependent on
another store (this may happen via chained memory copies). This is
done by searching if a store is a predecessor to another store's
value.

Prune the search at the candidate search's root node which is a
predecessor to all candidate stores. This reduces the
size of the subgraph searched in large basic blocks.

Diff Detail

Repository
rL LLVM
niravd created this revision.May 16 2018, 8:37 AM
jyknight accepted this revision.May 16 2018, 9:16 AM

Just some comments on the comments.

llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp
546 ↗(On Diff #147104)

Mention new arg in doc comment here and below.

13394 ↗(On Diff #147104)

This is not obvious. It'd be good to mention what you're excluding:
Operand 2: Address. Already verified all the addresses are constant offsets from each-other, so it would be impossible.
Operand 3: Offset, used only when isIndexed() is true, but we don't deal with indexed stores.

This revision is now accepted and ready to land.May 16 2018, 9:16 AM
This revision was automatically updated to reflect the committed changes.
niravd marked an inline comment as done.