aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/CodeGen/MachineScheduler.cpp
diff options
context:
space:
mode:
authorJay Foad <jay.foad@amd.com>2019-12-19 16:53:05 +0000
committerJay Foad <jay.foad@amd.com>2020-01-29 16:23:01 +0000
commit0d7bd343127ee161a01a1509effba0fdd480c9e1 (patch)
treeb35614ded6ce9169a586a483b17a4e5d7a7a6f40 /llvm/lib/CodeGen/MachineScheduler.cpp
parent96352e0a1bda0fc04729ff90d0d576e8f366760f (diff)
downloadllvm-0d7bd343127ee161a01a1509effba0fdd480c9e1.zip
llvm-0d7bd343127ee161a01a1509effba0fdd480c9e1.tar.gz
llvm-0d7bd343127ee161a01a1509effba0fdd480c9e1.tar.bz2
[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
Diffstat (limited to 'llvm/lib/CodeGen/MachineScheduler.cpp')
-rw-r--r--llvm/lib/CodeGen/MachineScheduler.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/llvm/lib/CodeGen/MachineScheduler.cpp b/llvm/lib/CodeGen/MachineScheduler.cpp
index aaa189e..ecfccaa 100644
--- a/llvm/lib/CodeGen/MachineScheduler.cpp
+++ b/llvm/lib/CodeGen/MachineScheduler.cpp
@@ -1620,7 +1620,7 @@ void BaseMemOpClusterMutation::apply(ScheduleDAGInstrs *DAG) {
unsigned ChainPredID = DAG->SUnits.size();
for (const SDep &Pred : SU.Preds) {
- if (Pred.isCtrl()) {
+ if (Pred.isCtrl() && !Pred.isArtificial()) {
ChainPredID = Pred.getSUnit()->NodeNum;
break;
}