Don't attempt MTM heuristics without a scheduling model present.
[oota-llvm.git] / lib / CodeGen / EarlyIfConversion.cpp
index 5447df09cbb27fff34c34f1bee0dd3f9d0789cb4..fc767362be75a334958e2bed51f0d57c2554d76d 100644 (file)
@@ -677,6 +677,10 @@ bool EarlyIfConverter::shouldConvertIf() {
   if (Stress)
     return true;
 
+  // Without a scheduling model, we can't make decisions.
+  if (!SchedModel->hasInstrSchedModel())
+    return false;
+
   if (!MinInstr)
     MinInstr = Traces->getEnsemble(MachineTraceMetrics::TS_MinInstrCount);