[Flang][OpenMP] Enable no-loop kernels (#155818)
Enable the generation of no-loop kernels for Fortran OpenMP code. target
teams distribute parallel do pragmas can be promoted to no-loop kernels
if the user adds the -fopenmp-assume-teams-oversubscription and
-fopenmp-assume-threads-oversubscription flags.
If the OpenMP kernel contains reduction or num_teams clauses, it is not
promoted to no-loop mode.
The global OpenMP device RTL oversubscription flags no longer force
no-loop code generation for Fortran.
GitOrigin-RevId: 83ef38a274b76c8877f15d3758d955772f91cf2d
diff --git a/device/src/Workshare.cpp b/device/src/Workshare.cpp
index 59a2cc3..653104c 100644
--- a/device/src/Workshare.cpp
+++ b/device/src/Workshare.cpp
@@ -800,10 +800,6 @@
// If we know we have more threads than iterations we can indicate that to
// avoid an outer loop.
- if (config::getAssumeThreadsOversubscription()) {
- OneIterationPerThread = true;
- }
-
if (OneIterationPerThread)
ASSERT(NumThreads >= NumIters, "Broken assumption");
@@ -851,10 +847,6 @@
// If we know we have more blocks than iterations we can indicate that to
// avoid an outer loop.
- if (config::getAssumeTeamsOversubscription()) {
- OneIterationPerThread = true;
- }
-
if (OneIterationPerThread)
ASSERT(NumBlocks >= NumIters, "Broken assumption");
@@ -914,11 +906,6 @@
// If we know we have more threads (across all blocks) than iterations we
// can indicate that to avoid an outer loop.
- if (config::getAssumeTeamsOversubscription() &
- config::getAssumeThreadsOversubscription()) {
- OneIterationPerThread = true;
- }
-
if (OneIterationPerThread)
ASSERT(NumBlocks * NumThreads >= NumIters, "Broken assumption");