summaryrefslogtreecommitdiffstats
path: root/llvm/lib/CodeGen/LLVMTargetMachine.cpp
diff options
context:
space:
mode:
authorQuentin Colombet <qcolombet@apple.com>2016-08-27 00:18:31 +0000
committerQuentin Colombet <qcolombet@apple.com>2016-08-27 00:18:31 +0000
commit374796d67853db94589da4aec48443e28e1a1590 (patch)
tree8f9ee74beac7679032a8f393856ad1eca0e876b3 /llvm/lib/CodeGen/LLVMTargetMachine.cpp
parenta94caa56736debed318eaf4dd20632d2132ebdf8 (diff)
downloadbcm5719-llvm-374796d67853db94589da4aec48443e28e1a1590.tar.gz
bcm5719-llvm-374796d67853db94589da4aec48443e28e1a1590.zip
[GlobalISel] Add a fallback path to SDISel.
When global-isel fails on a MachineFunction MF, MF will be cleaned up and given to SDISel. Thanks to this fallback, we can already perform correctness test even if we support only a small portion of the functions in a test. llvm-svn: 279891
Diffstat (limited to 'llvm/lib/CodeGen/LLVMTargetMachine.cpp')
-rw-r--r--llvm/lib/CodeGen/LLVMTargetMachine.cpp9
1 files changed, 9 insertions, 0 deletions
diff --git a/llvm/lib/CodeGen/LLVMTargetMachine.cpp b/llvm/lib/CodeGen/LLVMTargetMachine.cpp
index 844e1ffe681..e11eb014111 100644
--- a/llvm/lib/CodeGen/LLVMTargetMachine.cpp
+++ b/llvm/lib/CodeGen/LLVMTargetMachine.cpp
@@ -168,6 +168,15 @@ addPassesToGenerateCode(LLVMTargetMachine *TM, PassManagerBase &PM,
if (PassConfig->addGlobalInstructionSelect())
return nullptr;
+ // Pass to reset the MachineFunction if the ISel failed.
+ PM.add(createResetMachineFunctionPass());
+
+ // Provide a fallback path when we do not want to abort on
+ // not-yet-supported input.
+ if (LLVM_UNLIKELY(!PassConfig->isGlobalISelAbortEnabled()) &&
+ PassConfig->addInstSelector())
+ return nullptr;
+
} else if (PassConfig->addInstSelector())
return nullptr;
OpenPOWER on IntegriCloud