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)
llvm-svn: 179451

llvm/lib/CodeGen/TargetSchedule.cpp

index 783bfa1..1bf14db 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;