diff options
author | Wei Mi <wmi@google.com> | 2020-01-09 20:58:31 -0800 |
---|---|---|
committer | Wei Mi <wmi@google.com> | 2020-01-09 21:13:11 -0800 |
commit | 21a4710c67a97838dd75cf60ed24da11280800f8 (patch) | |
tree | 82d65d32b7d5d053ce7ec935f97e9b5afa224951 /llvm/lib/Passes/PassBuilder.cpp | |
parent | 01662aeb5d1fcef4f067caec633d0c85bb3062a7 (diff) | |
download | bcm5719-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/lib/Passes/PassBuilder.cpp')
-rw-r--r-- | llvm/lib/Passes/PassBuilder.cpp | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/llvm/lib/Passes/PassBuilder.cpp b/llvm/lib/Passes/PassBuilder.cpp index 646eb7d26cb..953b688c7f8 100644 --- a/llvm/lib/Passes/PassBuilder.cpp +++ b/llvm/lib/Passes/PassBuilder.cpp @@ -1902,6 +1902,12 @@ Error PassBuilder::parseModulePass(ModulePassManager &MPM, return Error::success(); } + // This is consistent with old pass manager invoked via opt, but + // inconsistent with clang. Clang doesn't enable loop vectorization + // but does enable slp vectorization at Oz. + PTO.LoopVectorization = L > O1 && L < Oz; + PTO.SLPVectorization = L > O1 && L < Oz; + if (Matches[1] == "default") { MPM.addPass(buildPerModuleDefaultPipeline(L, DebugLogging)); } else if (Matches[1] == "thinlto-pre-link") { |