[TargetSchedule] Minor refactor in computeInstrLatency. NFC

The intent of revision r300311 was to add a check for invalid scheduling class
descriptors. However, it ended up adding a redundant call in a basic block that
should not be reachable.

llvm-svn: 327231
This commit is contained in:
Andrea Di Biagio
2018-03-11 00:51:33 +00:00
parent 2282cc2a09
commit 6d18d6e4d3

View File

@@ -274,14 +274,12 @@ unsigned TargetSchedModel::computeInstrLatency(unsigned Opcode) const {
unsigned SCIdx = TII->get(Opcode).getSchedClass();
const MCSchedClassDesc *SCDesc = SchedModel.getSchedClassDesc(SCIdx);
if (SCDesc->isValid() && !SCDesc->isVariant())
if (!SCDesc->isValid())
return 0;
if (!SCDesc->isVariant())
return computeInstrLatency(*SCDesc);
if (SCDesc->isValid()) {
assert (!SCDesc->isVariant() && "No MI sched latency: SCDesc->isVariant()");
return computeInstrLatency(*SCDesc);
}
return 0;
llvm_unreachable("No MI sched latency");
}
unsigned