[PATCH] D133120: [OpenMP][Opt] Fix target region without parallel

Gheorghe-Teodor Bercea via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Sep 1 09:15:34 PDT 2022


doru1004 created this revision.
doru1004 added a reviewer: jdoerfert.
Herald added subscribers: nlopes, ormris, guansong, hiraditya, yaxunl.
Herald added a project: All.
doru1004 requested review of this revision.
Herald added a reviewer: sstefan1.
Herald added subscribers: llvm-commits, sstefan1.
Herald added a project: LLVM.

In the current setup the change to SPMD is abandoned if the target region does not contain any parallel regions. This actually does not stop the kernel from being considered SPMD by OpenMP Opt because this check is performed after the fixpoint is reached. This leads to an inconsistency between what the runtime thinks the execution mode is (generic) and what the code inside the kernel thinks the execution mode is (SPMD).

This patch fixes this problem by being more fine grained:

1. eliminate instruction guarding if no parallel regions are present.
2. since instructions aren't guarded anymore ensure that only the team main thread executes the target region.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D133120

Files:
  llvm/lib/Transforms/IPO/OpenMPOpt.cpp
  llvm/test/Transforms/OpenMP/get_hardware_num_threads_in_block_fold.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D133120.457296.patch
Type: text/x-patch
Size: 25561 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20220901/788986f0/attachment.bin>


More information about the llvm-commits mailing list