misched: fall-back to a target hook for instr bundles.
authorAndrew Trick <atrick@apple.com>
Wed, 10 Oct 2012 05:43:18 +0000 (05:43 +0000)
committerAndrew Trick <atrick@apple.com>
Wed, 10 Oct 2012 05:43:18 +0000 (05:43 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@165606 91177308-0d34-0410-b5e6-96231b3b80d8

lib/CodeGen/TargetSchedule.cpp

index edf68157ea950bcd74271baee9322a945d572460..4e753c6ecb4695e7908e85f45bac5df54c16c304 100644 (file)
@@ -203,10 +203,11 @@ unsigned TargetSchedModel::computeOperandLatency(
 }
 
 unsigned TargetSchedModel::computeInstrLatency(const MachineInstr *MI) const {
-  if (hasInstrItineraries()) {
-    // For the itinerary model, fall back to the old subtarget hook.
+  // For the itinerary model, fall back to the old subtarget hook.
+  // Allow subtargets to compute Bundle latencies outside the machine model.
+  if (hasInstrItineraries() || MI->isBundle())
     return TII->getInstrLatency(&InstrItins, MI);
-  }
+
   if (hasInstrSchedModel()) {
     unsigned Latency = 0;
     const MCSchedClassDesc *SCDesc = resolveSchedClass(MI);