From 1c06a73a7c300105e9f685d4388e0f2d6c0021a1 Mon Sep 17 00:00:00 2001 From: Quentin Colombet Date: Wed, 31 Aug 2016 18:43:04 +0000 Subject: [TargetPassConfig] Add a hook to tell whether GlobalISel should warm on fallback. Thanks to this patch, we know have a way to easly see if GlobalISel failed. llvm-svn: 280273 --- llvm/lib/CodeGen/TargetPassConfig.cpp | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) (limited to 'llvm/lib/CodeGen/TargetPassConfig.cpp') diff --git a/llvm/lib/CodeGen/TargetPassConfig.cpp b/llvm/lib/CodeGen/TargetPassConfig.cpp index 88b94f51928..1244681592b 100644 --- a/llvm/lib/CodeGen/TargetPassConfig.cpp +++ b/llvm/lib/CodeGen/TargetPassConfig.cpp @@ -98,11 +98,13 @@ PrintMachineInstrs("print-machineinstrs", cl::ValueOptional, cl::desc("Print machine instrs"), cl::value_desc("pass-name"), cl::init("option-unspecified")); -static cl::opt EnableGlobalISelAbort( +static cl::opt EnableGlobalISelAbort( "global-isel-abort", cl::Hidden, cl::desc("Enable abort calls when \"global\" instruction selection " - "fails to lower/select an instruction"), - cl::init(true)); + "fails to lower/select an instruction: 0 disable the abort, " + "1 enable the abort, and " + "2 disable the abort but emit a diagnostic on failure"), + cl::init(1)); // Temporary option to allow experimenting with MachineScheduler as a post-RA // scheduler. Targets can "properly" enable this with @@ -899,5 +901,9 @@ void TargetPassConfig::addBlockPlacement() { /// GlobalISel Configuration //===---------------------------------------------------------------------===// bool TargetPassConfig::isGlobalISelAbortEnabled() const { - return EnableGlobalISelAbort; + return EnableGlobalISelAbort == 1; +} + +bool TargetPassConfig::reportDiagnosticWhenGlobalISelFallback() const { + return EnableGlobalISelAbort == 2; } -- cgit v1.2.3