Adopt upstream OpenMP flag improvements (approved in llvm#178914)#1332
Adopt upstream OpenMP flag improvements (approved in llvm#178914)#1332nicebert wants to merge 4 commits intoamd-stagingfrom
Conversation
Add -fno-openmp-assume-no-thread-state and -fno-openmp-assume-no-nested-parallelism flags to allow explicit disabling of these assumptions. Currently these flags only exist as MarshallingInfoNegativeFlag which doesn't generate separate OPT_* constants needed for driver code. Making them standalone flags enables proper last-wins behavior and allows them to be used in implication logic.
Add a new flag to indicate that the OpenMP runtime can ignore environment variables during code generation for GPU offload. This allows the compiler to generate more efficient GPU code by assuming environment variables won't affect runtime behavior, enabling optimizations like skipping runtime checks and eliminating conditional branches. The flag includes both positive and negative variants and will be used by the -fopenmp-target-fast meta-flag.
Add meta-flag that implies multiple GPU optimization flags: - -fopenmp-target-ignore-env-vars - -fopenmp-assume-no-thread-state - -fopenmp-assume-no-nested-parallelism The flag is automatically enabled by -Ofast and can be explicitly disabled with -fno-openmp-target-fast. Individual implied flags can be selectively overridden while keeping others enabled.
|
Thank you for submitting a Pull Request (PR) to the LLVM Project! This PR will be automatically labeled and the relevant teams will be notified. If you wish to, you can add reviewers by using the "Reviewers" section on this page. If this is not working for you, it is probably because you do not have write permissions for the repository. In which case you can instead tag reviewers by name in a comment by using If you have received no comments on your PR for a week, you can request a review by "ping"ing the PR by adding a comment “Ping”. The common courtesy "ping" rate is once a week. Please remember that you are asking for valuable time from other developers. If you have further questions, they may be answered by the LLVM GitHub User Guide. You can also ask questions in a comment on this PR, on the LLVM Discord or on the forums. |
376bc55 to
e78d11c
Compare
e78d11c to
7a5975c
Compare
…adopt-upstream-openmp # Conflicts: # clang/include/clang/Options/Options.td # clang/lib/Driver/ToolChains/Clang.cpp # clang/test/Driver/openmp-target-fast-flag.c
7a5975c to
75c250a
Compare
This PR adopts OpenMP flag improvements that have been approved for upstream LLVM (PR llvm#178914) but haven't merged yet.
Changes:
Upstream Reference: llvm#178914