From 59313be8d3389918d0a1bf704bcbdd889c073ffc Mon Sep 17 00:00:00 2001 From: Sanjay Patel Date: Tue, 5 Jun 2018 23:34:45 +0000 Subject: [CodeGen] assume max/default throughput for unspecified instructions This is a fix for the problem arising in D47374 (PR37678): https://bugs.llvm.org/show_bug.cgi?id=37678 We may not have throughput info because it's not specified in the model or it's not available with variant scheduling, so assume that those instructions can execute/complete at max-issue-width. Differential Revision: https://reviews.llvm.org/D47723 llvm-svn: 334055 --- llvm/lib/CodeGen/TargetSchedule.cpp | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) (limited to 'llvm/lib/CodeGen/TargetSchedule.cpp') diff --git a/llvm/lib/CodeGen/TargetSchedule.cpp b/llvm/lib/CodeGen/TargetSchedule.cpp index 2709df5697b..3cff31ad493 100644 --- a/llvm/lib/CodeGen/TargetSchedule.cpp +++ b/llvm/lib/CodeGen/TargetSchedule.cpp @@ -322,7 +322,7 @@ computeOutputLatency(const MachineInstr *DefMI, unsigned DefOperIdx, return 0; } -Optional +double TargetSchedModel::computeReciprocalThroughput(const MachineInstr *MI) const { if (hasInstrItineraries()) { unsigned SchedClass = MI->getDesc().getSchedClass(); @@ -332,10 +332,11 @@ TargetSchedModel::computeReciprocalThroughput(const MachineInstr *MI) const { if (hasInstrSchedModel()) return MCSchedModel::getReciprocalThroughput(*STI, *resolveSchedClass(MI)); - return Optional(); + + return 0.0; } -Optional +double TargetSchedModel::computeReciprocalThroughput(unsigned Opcode) const { unsigned SchedClass = TII->get(Opcode).getSchedClass(); if (hasInstrItineraries()) @@ -346,10 +347,11 @@ TargetSchedModel::computeReciprocalThroughput(unsigned Opcode) const { if (SCDesc.isValid() && !SCDesc.isVariant()) return MCSchedModel::getReciprocalThroughput(*STI, SCDesc); } - return Optional(); + + return 0.0; } -Optional +double TargetSchedModel::computeReciprocalThroughput(const MCInst &MI) const { if (hasInstrSchedModel()) return SchedModel.getReciprocalThroughput(*STI, *TII, MI); -- cgit v1.2.3