[flang-commits] [flang] [Flang][OpenMP] Skip DSA for canonical loops (PR #150593)
Sergio Afonso via flang-commits
flang-commits at lists.llvm.org
Tue Jul 29 05:01:20 PDT 2025
================
@@ -1224,7 +1236,7 @@ static void createBodyOfOp(mlir::Operation &op, const OpWithBodyGenInfo &info,
// code will use the right symbols.
bool isLoop = llvm::omp::getDirectiveAssociation(info.dir) ==
llvm::omp::Association::Loop;
- bool privatize = info.clauses;
+ bool privatize = info.clauses && info.privatize;
----------------
skatrak wrote:
I've looked around a bit and I noticed there are two spots where decisions are made based off of the directive association of the directive being lowered (i.e. calls to `llvm::omp::getDirectiveAssociation`). One of them impacts whether a new scope is created for the sym table in `genOMPDispatch`, which I'm not sure if that's what we expect to do for a loop transformation, since up until now it only dealt with worksharing-type directives. The other impacts privatization inside of `createBodyOfOp`.
I'm not sure what impact preventing this to happen for loop transformations might have, but seeing that you're having to work around problems related to finding symbols, etc. perhaps that might be something to look into, in case it's the source of the issues.
https://github.com/llvm/llvm-project/pull/150593
More information about the flang-commits
mailing list