[all-commits] [llvm/llvm-project] 9833a5: [OpenMP] Run an extra 'OpenMPOpt' pass in LTO-mode
Joseph Huber via All-commits
all-commits at lists.llvm.org
Fri Jan 27 20:45:27 PST 2023
Branch: refs/heads/release/16.x
Home: https://github.com/llvm/llvm-project
Commit: 9833a552e36c3a9fb6491d00a2b22830fad91bef
https://github.com/llvm/llvm-project/commit/9833a552e36c3a9fb6491d00a2b22830fad91bef
Author: Joseph Huber <jhuber6 at vols.utk.edu>
Date: 2023-01-27 (Fri, 27 Jan 2023)
Changed paths:
M clang/tools/clang-linker-wrapper/ClangLinkerWrapper.cpp
M llvm/lib/Passes/PassBuilderPipelines.cpp
M llvm/test/Other/new-pm-lto-defaults.ll
Log Message:
-----------
[OpenMP] Run an extra 'OpenMPOpt' pass in LTO-mode
The `OpenMPOpt` pass is pivotal to the performance of many OpenMP
offloading programs. When we perform non-LTO builds with OpenMP we used
to link the OpenMP deviceRTL individually for each TU. This lead to us
getting an additional attributor run on the combined runtime and user
code. When we used LTO we lost a run and suffered a large performance
degradation. This patch simply adds in the extra `OpenMPOpt` pass that
we miss into the LTO pipeline. This patch fixes the performance
regression shown in applications that used OpenMP offloading in LTO
mode.
Previously, this wasn't legal to do as we could emit new runtime calls
into the module. That was fixed by D142646.
Depends on D142646
Fixes https://github.com/llvm/llvm-project/issues/60300
Reviewed By: jdoerfert
Differential Revision: https://reviews.llvm.org/D142650
(cherry picked from commit 6185246f4f62345d0cfdaef62da7e15b01d52557)
Commit: c0e53ac3c3da7cda6af3b0f056cc8174c3bae44c
https://github.com/llvm/llvm-project/commit/c0e53ac3c3da7cda6af3b0f056cc8174c3bae44c
Author: Joseph Huber <jhuber6 at vols.utk.edu>
Date: 2023-01-27 (Fri, 27 Jan 2023)
Changed paths:
M llvm/include/llvm/Transforms/IPO/OpenMPOpt.h
M llvm/lib/Passes/PassBuilderPipelines.cpp
M llvm/lib/Passes/PassRegistry.def
M llvm/lib/Transforms/IPO/OpenMPOpt.cpp
M llvm/test/Transforms/OpenMP/custom_state_machines_pre_lto.ll
M llvm/test/Transforms/OpenMP/spmdization.ll
Log Message:
-----------
[OpenMP] Make OpenMPOpt aware of the OpenMP runtime's status
The `OpenMPOpt` pass contains optimizations that generate new calls into
the OpenMP runtime. This causes problems if we are in a state where the
runtime has already been linked statically. Generating these new calls
will result in them never being resolved. We should indicate if we are
in a "post-link" LTO phase and prevent OpenMPOpt from generating new
runtime calls.
Generally, it's not desireable for passes to maintain state about the
context in which they're called. But this is the only reasonable
solution to static linking when we have a pass that generates new
runtime calls.
Reviewed By: jdoerfert
Differential Revision: https://reviews.llvm.org/D142646
(cherry picked from commit 0bdde9dfb9b1dbfabee147c196db820e1f5dca1f)
Compare: https://github.com/llvm/llvm-project/compare/84f3164c1d9c...c0e53ac3c3da
More information about the All-commits
mailing list