[PATCH] D29845: [SelectionDAG] Remove redundant stores more aggressively.

Eli Friedman via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Feb 21 11:02:03 PST 2017


efriedma added a comment.

> The chain dependence subgraph does _not_ capture the full dependencies of any two nodes in the subgraph. It only captures straight control dependencies in frame.

That's true, but we don't need the full dependencies to remove a redundant store, only the control dependencies.  The control dependencies are what determines the range in which a loaded value is valid, and the range in which a store is allowed to modify memory; it doesn't matter whether we could actually schedule the DAG in that order.  In other words, it's legal to duplicate a load or store.  This is fundamental to the way we reason about memory in SelectionDAG: for example, legalization depends on this to allow splitting loads and stores.

I'll add a comment to clarify this.


Repository:
  rL LLVM

https://reviews.llvm.org/D29845





More information about the llvm-commits mailing list