From 423d6744123e4886f9f79f6273fa345b9cce51a8 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. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@178558 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/CodeGen/EarlyIfConversion.cpp | 4 ++++ test/CodeGen/X86/early-ifcvt-crash.ll | 2 ++ 2 files changed, 6 insertions(+) diff --git a/lib/CodeGen/EarlyIfConversion.cpp b/lib/CodeGen/EarlyIfConversion.cpp index 5447df09cbb..fc767362be7 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 c8280269689..d9580503e91 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. ;