[PATCH] D142650: [OpenMP] Run an extra 'OpenMPOpt' pass in LTO-mode
Joseph Huber via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Thu Jan 26 10:01:00 PST 2023
jhuber6 updated this revision to Diff 492498.
jhuber6 added a comment.
Herald added subscribers: ormris, steven_wu.
Fix test
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D142650/new/
https://reviews.llvm.org/D142650
Files:
clang/tools/clang-linker-wrapper/ClangLinkerWrapper.cpp
llvm/lib/Passes/PassBuilderPipelines.cpp
llvm/test/Other/new-pm-lto-defaults.ll
Index: llvm/test/Other/new-pm-lto-defaults.ll
===================================================================
--- llvm/test/Other/new-pm-lto-defaults.ll
+++ llvm/test/Other/new-pm-lto-defaults.ll
@@ -79,6 +79,7 @@
; CHECK-O23SZ-NEXT: Invalidating analysis: InlineAdvisorAnalysis
; CHECK-O23SZ-NEXT: Running pass: GlobalOptPass
; CHECK-O23SZ-NEXT: Running pass: GlobalDCEPass
+; CHECK-O23SZ-NEXT: Running pass: OpenMPOptPass
; CHECK-O23SZ-NEXT: Running pass: ArgumentPromotionPass
; CHECK-O23SZ-NEXT: Running pass: DeadArgumentEliminationPass
; CHECK-O23SZ-NEXT: Running pass: InstCombinePass
Index: llvm/lib/Passes/PassBuilderPipelines.cpp
===================================================================
--- llvm/lib/Passes/PassBuilderPipelines.cpp
+++ llvm/lib/Passes/PassBuilderPipelines.cpp
@@ -1715,6 +1715,9 @@
// Garbage collect dead functions.
MPM.addPass(GlobalDCEPass());
+ // Run the OpenMPOpt pass again after global optimizations.
+ MPM.addPass(OpenMPOptPass(ThinOrFullLTOPhase::FullLTOPostLink));
+
// If we didn't decide to inline a function, check to see if we can
// transform it to pass arguments by value instead of by reference.
MPM.addPass(createModuleToPostOrderCGSCCPassAdaptor(ArgumentPromotionPass()));
Index: clang/tools/clang-linker-wrapper/ClangLinkerWrapper.cpp
===================================================================
--- clang/tools/clang-linker-wrapper/ClangLinkerWrapper.cpp
+++ clang/tools/clang-linker-wrapper/ClangLinkerWrapper.cpp
@@ -513,8 +513,6 @@
assert(CGOptLevelOrNone && "Invalid optimization level");
Conf.CGOptLevel = *CGOptLevelOrNone;
Conf.OptLevel = OptLevel[1] - '0';
- if (Conf.OptLevel > 0)
- Conf.UseDefaultPipeline = true;
Conf.DefaultTriple = Triple.getTriple();
LTOError = false;
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D142650.492498.patch
Type: text/x-patch
Size: 1800 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20230126/6f2afc5f/attachment.bin>
More information about the llvm-commits
mailing list