summaryrefslogtreecommitdiffstats
path: root/llvm/lib/CodeGen/TargetPassConfig.cpp
diff options
context:
space:
mode:
authorAmara Emerson <aemerson@apple.com>2018-01-02 16:30:47 +0000
committerAmara Emerson <aemerson@apple.com>2018-01-02 16:30:47 +0000
commit854d10d10bf5ae315fac43d37f84626d7a9c5edf (patch)
treefedf15410244258fca600aeab7ef71db382c113d /llvm/lib/CodeGen/TargetPassConfig.cpp
parent0d0f1ff719c3b92a8bbda4327e8dd6e9cf936a09 (diff)
downloadbcm5719-llvm-854d10d10bf5ae315fac43d37f84626d7a9c5edf.tar.gz
bcm5719-llvm-854d10d10bf5ae315fac43d37f84626d7a9c5edf.zip
[AArch64][GlobalISel] Enable GlobalISel at -O0 by default
Tests updated to explicitly use fast-isel at -O0 instead of implicitly. This change also allows an explicit -fast-isel option to override an implicitly enabled global-isel. Otherwise -fast-isel would have no effect at -O0. Differential Revision: https://reviews.llvm.org/D41362 llvm-svn: 321655
Diffstat (limited to 'llvm/lib/CodeGen/TargetPassConfig.cpp')
-rw-r--r--llvm/lib/CodeGen/TargetPassConfig.cpp12
1 files changed, 10 insertions, 2 deletions
diff --git a/llvm/lib/CodeGen/TargetPassConfig.cpp b/llvm/lib/CodeGen/TargetPassConfig.cpp
index 121bed5a79c..c90a93d7e24 100644
--- a/llvm/lib/CodeGen/TargetPassConfig.cpp
+++ b/llvm/lib/CodeGen/TargetPassConfig.cpp
@@ -712,8 +712,11 @@ bool TargetPassConfig::addCoreISelPasses() {
// Ask the target for an isel.
// Enable GlobalISel if the target wants to, but allow that to be overriden.
+ // Explicitly enabling fast-isel should override implicitly enabled
+ // global-isel.
if (EnableGlobalISel == cl::BOU_TRUE ||
- (EnableGlobalISel == cl::BOU_UNSET && isGlobalISelEnabled())) {
+ (EnableGlobalISel == cl::BOU_UNSET && isGlobalISelEnabled() &&
+ EnableFastISelOption != cl::BOU_TRUE)) {
if (addIRTranslator())
return true;
@@ -1133,7 +1136,12 @@ bool TargetPassConfig::isGlobalISelEnabled() const {
}
bool TargetPassConfig::isGlobalISelAbortEnabled() const {
- return EnableGlobalISelAbort == 1;
+ if (EnableGlobalISelAbort.getNumOccurrences() > 0)
+ return EnableGlobalISelAbort == 1;
+
+ // When no abort behaviour is specified, we don't abort if the target says
+ // that GISel is enabled.
+ return !isGlobalISelEnabled();
}
bool TargetPassConfig::reportDiagnosticWhenGlobalISelFallback() const {
OpenPOWER on IntegriCloud