[all-commits] [llvm/llvm-project] 0d7bd3: [MachineScheduler] Ignore artificial edges when fo...

jayfoad via All-commits all-commits at lists.llvm.org
Wed Jan 29 08:23:17 PST 2020


  Branch: refs/heads/master
  Home:   https://github.com/llvm/llvm-project
  Commit: 0d7bd343127ee161a01a1509effba0fdd480c9e1
      https://github.com/llvm/llvm-project/commit/0d7bd343127ee161a01a1509effba0fdd480c9e1
  Author: Jay Foad <jay.foad at amd.com>
  Date:   2020-01-29 (Wed, 29 Jan 2020)

  Changed paths:
    M llvm/lib/CodeGen/MachineScheduler.cpp
    A llvm/test/CodeGen/AMDGPU/cluster_stores.ll

  Log Message:
  -----------
  [MachineScheduler] Ignore artificial edges when forming store chains

Summary:
BaseMemOpClusterMutation::apply forms store chains by looking for
control (i.e. non-data) 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 as
described in the comment:
      // Copy successor edges from SUa to SUb. Interleaving computation
      // dependent on SUa can prevent load combining due to register reuse.
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.

The fix is to only consider non-artificial control dependencies when
forming chains.

Subscribers: MatzeB, jvesely, nhaehnle, hiraditya, javed.absar, llvm-commits

Tags: #llvm

Differential Revision: https://reviews.llvm.org/D71717




More information about the All-commits mailing list