[PATCH] D142646: [OpenMP] Make OpenMPOpt aware of the OpenMP runtime's status

Joseph Huber via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Jan 26 09:20:15 PST 2023


jhuber6 created this revision.
jhuber6 added reviewers: jdoerfert, tianshilei1992, ye-luo, fhahn, JonChesterfield, ronlieb.
Herald added subscribers: ormris, StephenFan, steven_wu, guansong, hiraditya, yaxunl.
Herald added a project: All.
jhuber6 requested review of this revision.
Herald added subscribers: llvm-commits, sstefan1.
Herald added a project: LLVM.

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.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D142646

Files:
  llvm/include/llvm/Transforms/IPO/OpenMPOpt.h
  llvm/lib/Passes/PassBuilderPipelines.cpp
  llvm/lib/Passes/PassRegistry.def
  llvm/lib/Transforms/IPO/OpenMPOpt.cpp
  llvm/test/Transforms/OpenMP/custom_state_machines_pre_lto.ll
  llvm/test/Transforms/OpenMP/spmdization.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D142646.492481.patch
Type: text/x-patch
Size: 10114 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20230126/7acca3b8/attachment.bin>


More information about the llvm-commits mailing list