Skip to content

Commit

Permalink
added warning
Browse files Browse the repository at this point in the history
Signed-off-by: Alexandre Eichenberger <alexe@us.ibm.com>
  • Loading branch information
AlexandreEichenberger committed Sep 18, 2024
1 parent 88fba85 commit 1e885ae
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/Transform/ProcessKrnlParallelClause.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,13 @@ struct ProcessKrnlParallelClauseWithoutScopePattern
if (numThreads) {
LLVM_DEBUG(llvm::dbgs() << " with a specific num_threads clause\n");
// Set the numbers of threads as indicated by clause op.
// WARNING: by moving the use of numThreads from inside the loop to the
// outer OpenMP parallel construct, we may potentially move the use of
// numThreads before its definition. However, because numThreads is by
// definition loop invariant, it is very unlikely that this case occurs.
// Nevertheless, this warning attests that this might be a possibility.
// In such case, we would get a compiler warning/error of use before
// def.
MutableOperandRange mutableNumThreads = parOp.getNumThreadsMutable();
mutableNumThreads.assign(numThreads);
}
Expand Down

0 comments on commit 1e885ae

Please sign in to comment.