From 8fbfc59164b37f27854e3283c7c8812c8154f942 Mon Sep 17 00:00:00 2001 From: Jakob Stoklund Olesen Date: Tue, 2 Apr 2013 18:26:45 +0000 Subject: [PATCH] Don't attempt MTM heuristics without a scheduling model present. This should fix the PPC buildbots. llvm-svn: 178558 --- llvm/lib/CodeGen/EarlyIfConversion.cpp | 4 ++++ llvm/test/CodeGen/X86/early-ifcvt-crash.ll | 2 ++ 2 files changed, 6 insertions(+) diff --git a/llvm/lib/CodeGen/EarlyIfConversion.cpp b/llvm/lib/CodeGen/EarlyIfConversion.cpp index 5447df09cbb2..fc767362be75 100644 --- a/llvm/lib/CodeGen/EarlyIfConversion.cpp +++ b/llvm/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/llvm/test/CodeGen/X86/early-ifcvt-crash.ll b/llvm/test/CodeGen/X86/early-ifcvt-crash.ll index c8280269689d..d9580503e91e 100644 --- a/llvm/test/CodeGen/X86/early-ifcvt-crash.ll +++ b/llvm/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. ;