aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJakob Stoklund Olesen <stoklund@2pi.dk>2013-04-02 18:26:45 +0000
committerJakob Stoklund Olesen <stoklund@2pi.dk>2013-04-02 18:26:45 +0000
commit423d6744123e4886f9f79f6273fa345b9cce51a8 (patch)
tree2ec927ae3d7c19664d409b9a27beab5aa1318816
parent8396e130427999c57422e52af3913eb8182847e5 (diff)
downloadexternal_llvm-423d6744123e4886f9f79f6273fa345b9cce51a8.zip
external_llvm-423d6744123e4886f9f79f6273fa345b9cce51a8.tar.gz
external_llvm-423d6744123e4886f9f79f6273fa345b9cce51a8.tar.bz2
Don't attempt MTM heuristics without a scheduling model present.
This should fix the PPC buildbots. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@178558 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r--lib/CodeGen/EarlyIfConversion.cpp4
-rw-r--r--test/CodeGen/X86/early-ifcvt-crash.ll2
2 files changed, 6 insertions, 0 deletions
diff --git a/lib/CodeGen/EarlyIfConversion.cpp b/lib/CodeGen/EarlyIfConversion.cpp
index 5447df0..fc76736 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);
diff --git a/test/CodeGen/X86/early-ifcvt-crash.ll b/test/CodeGen/X86/early-ifcvt-crash.ll
index c828026..d958050 100644
--- a/test/CodeGen/X86/early-ifcvt-crash.ll
+++ b/test/CodeGen/X86/early-ifcvt-crash.ll
@@ -1,5 +1,7 @@
; RUN: llc < %s -x86-early-ifcvt -verify-machineinstrs
; RUN: llc < %s -x86-early-ifcvt -stress-early-ifcvt -verify-machineinstrs
+; CPU without a scheduling model:
+; RUN: llc < %s -x86-early-ifcvt -mcpu=pentium3 -verify-machineinstrs
;
; Run these tests with and without -stress-early-ifcvt to exercise heuristics.
;