MI-Sched cleanup. If an instruction has no valid sched class, do not attempt to check...
authorAndrew Trick <atrick@apple.com>
Sat, 13 Apr 2013 06:07:45 +0000 (06:07 +0000)
committerAndrew Trick <atrick@apple.com>
Sat, 13 Apr 2013 06:07:45 +0000 (06:07 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@179451 91177308-0d34-0410-b5e6-96231b3b80d8

lib/CodeGen/TargetSchedule.cpp

index 783bfa1c1a1887c4f2215130952b2b7ebcfbc222..1bf14dbcef2cf50651385483afd7179342f33b94 100644 (file)
@@ -128,6 +128,8 @@ resolveSchedClass(const MachineInstr *MI) const {
   // Get the definition's scheduling class descriptor from this machine model.
   unsigned SchedClass = MI->getDesc().getSchedClass();
   const MCSchedClassDesc *SCDesc = SchedModel.getSchedClassDesc(SchedClass);
+  if (!SCDesc->isValid())
+    return SCDesc;
 
 #ifndef NDEBUG
   unsigned NIter = 0;