summaryrefslogtreecommitdiffstats
path: root/llvm/tools
diff options
context:
space:
mode:
authorWei Mi <wmi@google.com>2020-01-09 20:58:31 -0800
committerWei Mi <wmi@google.com>2020-01-09 21:13:11 -0800
commit21a4710c67a97838dd75cf60ed24da11280800f8 (patch)
tree82d65d32b7d5d053ce7ec935f97e9b5afa224951 /llvm/tools
parent01662aeb5d1fcef4f067caec633d0c85bb3062a7 (diff)
downloadbcm5719-llvm-21a4710c67a97838dd75cf60ed24da11280800f8.tar.gz
bcm5719-llvm-21a4710c67a97838dd75cf60ed24da11280800f8.zip
[ThinLTO] Pass CodeGenOpts like UnrollLoops/VectorizeLoop/VectorizeSLP
down to pass builder in ltobackend. Currently CodeGenOpts like UnrollLoops/VectorizeLoop/VectorizeSLP in clang are not passed down to pass builder in ltobackend when new pass manager is used. This is inconsistent with the behavior when new pass manager is used and thinlto is not used. Such inconsistency causes slp vectorization pass not being enabled in ltobackend for O3 + thinlto right now. This patch fixes that. Differential Revision: https://reviews.llvm.org/D72386
Diffstat (limited to 'llvm/tools')
-rw-r--r--llvm/tools/gold/gold-plugin.cpp3
-rw-r--r--llvm/tools/llvm-lto2/CMakeLists.txt1
-rw-r--r--llvm/tools/llvm-lto2/llvm-lto2.cpp2
3 files changed, 6 insertions, 0 deletions
diff --git a/llvm/tools/gold/gold-plugin.cpp b/llvm/tools/gold/gold-plugin.cpp
index d355184f866..406079dad30 100644
--- a/llvm/tools/gold/gold-plugin.cpp
+++ b/llvm/tools/gold/gold-plugin.cpp
@@ -860,6 +860,9 @@ static std::unique_ptr<LTO> createLTO(IndexWriteCallback OnIndexWrite,
Conf.CGOptLevel = getCGOptLevel();
Conf.DisableVerify = options::DisableVerify;
Conf.OptLevel = options::OptLevel;
+ Conf.PTO.LoopVectorization = options::OptLevel > 1;
+ Conf.PTO.SLPVectorization = options::OptLevel > 1;
+
if (options::Parallelism)
Backend = createInProcessThinBackend(options::Parallelism);
if (options::thinlto_index_only) {
diff --git a/llvm/tools/llvm-lto2/CMakeLists.txt b/llvm/tools/llvm-lto2/CMakeLists.txt
index 7f2db01c9c9..fa2d8624fd9 100644
--- a/llvm/tools/llvm-lto2/CMakeLists.txt
+++ b/llvm/tools/llvm-lto2/CMakeLists.txt
@@ -9,6 +9,7 @@ set(LLVM_LINK_COMPONENTS
LTO
MC
Object
+ Passes
Support
Target
)
diff --git a/llvm/tools/llvm-lto2/llvm-lto2.cpp b/llvm/tools/llvm-lto2/llvm-lto2.cpp
index 5e3b3dcb6c3..67a677dd45f 100644
--- a/llvm/tools/llvm-lto2/llvm-lto2.cpp
+++ b/llvm/tools/llvm-lto2/llvm-lto2.cpp
@@ -270,6 +270,8 @@ static int run(int argc, char **argv) {
Conf.OverrideTriple = OverrideTriple;
Conf.DefaultTriple = DefaultTriple;
Conf.StatsFile = StatsFile;
+ Conf.PTO.LoopVectorization = Conf.OptLevel > 1;
+ Conf.PTO.SLPVectorization = Conf.OptLevel > 1;
ThinBackend Backend;
if (ThinLTODistributedIndexes)
OpenPOWER on IntegriCloud