[PATCH] D73509: [MachineScheduler] relax successfor chain on clustering

Stanislav Mekhanoshin via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Jan 27 14:52:26 PST 2020


rampitec created this revision.
rampitec added reviewers: foad, kerbowa, vpykhtin, atrick, MatzeB, arsenm, nhaehnle.
Herald added subscribers: javed.absar, hiraditya, wdng, jvesely.
Herald added a project: LLVM.

BaseMemOpClusterMutation::apply forms store chains by looking for
control dependencies from one mem op to another.

In the test case, clusterNeighboringMemOps successfully clusters the
loads, and then adds artificial edges to the loads' successors.

The effect of this is that data dependencies from one load to a store
are copied as artificial dependencies from a different load to the
same store.

Then when BaseMemOpClusterMutation::apply looks at the stores, it finds
that some of them have a control dependency on a previous load, which
breaks the chains and means that the stores are not all considered part
of the same chain and won't all be clustered.

In fact to prevent scheduling of a successor of any load in a cluster
inside the cluster that is sufficient to transfer all successors only
to the last node in the chain. That last node becomes a sentinel for
the whole cluster, but no extra dependencies are created.


https://reviews.llvm.org/D73509

Files:
  llvm/lib/CodeGen/MachineScheduler.cpp
  llvm/test/CodeGen/AMDGPU/cluster_stores.ll
  llvm/test/CodeGen/AMDGPU/promote-constOffset-to-imm.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D73509.240690.patch
Type: text/x-patch
Size: 7954 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20200127/eb20b78b/attachment.bin>


More information about the llvm-commits mailing list