diff --git a/lib/CodeGen/ScheduleDAGInstrs.cpp b/lib/CodeGen/ScheduleDAGInstrs.cpp index 06d8ed9b25d..ec8fc66a3ee 100644 --- a/lib/CodeGen/ScheduleDAGInstrs.cpp +++ b/lib/CodeGen/ScheduleDAGInstrs.cpp @@ -99,6 +99,9 @@ void ScheduleDAGInstrs::BuildSchedUnits() { Terminator->addPred(SU, /*isCtrl=*/false, /*isSpecial=*/false); if (MI->getDesc().isTerminator() || MI->isLabel()) Terminator = SU; + + // Assign the Latency field of SU using target-provided information. + ComputeLatency(SU); } } diff --git a/lib/CodeGen/SelectionDAG/ScheduleDAGSDNodes.cpp b/lib/CodeGen/SelectionDAG/ScheduleDAGSDNodes.cpp index 91a8294e1d4..aef23c5d49b 100644 --- a/lib/CodeGen/SelectionDAG/ScheduleDAGSDNodes.cpp +++ b/lib/CodeGen/SelectionDAG/ScheduleDAGSDNodes.cpp @@ -132,6 +132,7 @@ void ScheduleDAGSDNodes::BuildSchedUnits() { assert(N->getNodeId() == -1 && "Node already inserted!"); N->setNodeId(NodeSUnit->NodeNum); + // Assign the Latency field of NodeSUnit using target-provided information. ComputeLatency(NodeSUnit); }