diff options
Diffstat (limited to 'llvm/lib')
| -rw-r--r-- | llvm/lib/CodeGen/LLVMTargetMachine.cpp | 3 | ||||
| -rw-r--r-- | llvm/lib/CodeGen/TargetPassConfig.cpp | 14 |
2 files changed, 12 insertions, 5 deletions
diff --git a/llvm/lib/CodeGen/LLVMTargetMachine.cpp b/llvm/lib/CodeGen/LLVMTargetMachine.cpp index e11eb014111..c094ab80052 100644 --- a/llvm/lib/CodeGen/LLVMTargetMachine.cpp +++ b/llvm/lib/CodeGen/LLVMTargetMachine.cpp @@ -169,7 +169,8 @@ addPassesToGenerateCode(LLVMTargetMachine *TM, PassManagerBase &PM, return nullptr; // Pass to reset the MachineFunction if the ISel failed. - PM.add(createResetMachineFunctionPass()); + PM.add(createResetMachineFunctionPass( + PassConfig->reportDiagnosticWhenGlobalISelFallback())); // Provide a fallback path when we do not want to abort on // not-yet-supported input. 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<bool> EnableGlobalISelAbort( +static cl::opt<int> 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; } |

