[llvm] c3a2929 - Let targets adjust physical output- and anti-deps
Fraser Cormack via llvm-commits
llvm-commits at lists.llvm.org
Tue Apr 21 05:49:33 PDT 2020
Author: Fraser Cormack
Date: 2020-04-21T13:45:03+01:00
New Revision: c3a292961d84e69d6dd2a63d3c1630c8e934577c
URL: https://github.com/llvm/llvm-project/commit/c3a292961d84e69d6dd2a63d3c1630c8e934577c
DIFF: https://github.com/llvm/llvm-project/commit/c3a292961d84e69d6dd2a63d3c1630c8e934577c.diff
LOG: Let targets adjust physical output- and anti-deps
Differential Revision: https://reviews.llvm.org/D78380
Added:
Modified:
llvm/lib/CodeGen/ScheduleDAGInstrs.cpp
Removed:
################################################################################
diff --git a/llvm/lib/CodeGen/ScheduleDAGInstrs.cpp b/llvm/lib/CodeGen/ScheduleDAGInstrs.cpp
index 039de203fca7..edc5c4bdda3d 100644
--- a/llvm/lib/CodeGen/ScheduleDAGInstrs.cpp
+++ b/llvm/lib/CodeGen/ScheduleDAGInstrs.cpp
@@ -294,6 +294,8 @@ void ScheduleDAGInstrs::addPhysRegDeps(SUnit *SU, unsigned OperIdx) {
if (MRI.isConstantPhysReg(Reg))
return;
+ const TargetSubtargetInfo &ST = MF.getSubtarget();
+
// Optionally add output and anti dependencies. For anti
// dependencies we use a latency of 0 because for a multi-issue
// target we want to allow the defining instruction to issue
@@ -311,14 +313,12 @@ void ScheduleDAGInstrs::addPhysRegDeps(SUnit *SU, unsigned OperIdx) {
if (DefSU != SU &&
(Kind != SDep::Output || !MO.isDead() ||
!DefSU->getInstr()->registerDefIsDead(*Alias))) {
- if (Kind == SDep::Anti)
- DefSU->addPred(SDep(SU, Kind, /*Reg=*/*Alias));
- else {
- SDep Dep(SU, Kind, /*Reg=*/*Alias);
+ SDep Dep(SU, Kind, /*Reg=*/*Alias);
+ if (Kind != SDep::Anti)
Dep.setLatency(
SchedModel.computeOutputLatency(MI, OperIdx, DefSU->getInstr()));
- DefSU->addPred(Dep);
- }
+ ST.adjustSchedDependency(SU, OperIdx, DefSU, I->OpIdx, Dep);
+ DefSU->addPred(Dep);
}
}
}
More information about the llvm-commits
mailing list