aboutsummaryrefslogtreecommitdiff
path: root/lib/CodeGen/EarlyIfConversion.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'lib/CodeGen/EarlyIfConversion.cpp')
-rw-r--r--lib/CodeGen/EarlyIfConversion.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/lib/CodeGen/EarlyIfConversion.cpp b/lib/CodeGen/EarlyIfConversion.cpp
index 5447df09cb..fc767362be 100644
--- a/lib/CodeGen/EarlyIfConversion.cpp
+++ b/lib/CodeGen/EarlyIfConversion.cpp
@@ -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);