File tree Expand file tree Collapse file tree 1 file changed +17
-4
lines changed
flang/lib/Optimizer/OpenMP Expand file tree Collapse file tree 1 file changed +17
-4
lines changed Original file line number Diff line number Diff line change @@ -40,10 +40,23 @@ using namespace mlir;
40
40
41
41
namespace flangomp {
42
42
bool shouldUseWorkshareLowering (Operation *op) {
43
- auto workshare = dyn_cast<omp::WorkshareOp>(op->getParentOp ());
44
- if (!workshare)
45
- return false ;
46
- return workshare->getParentOfType <omp::ParallelOp>();
43
+ // TODO this is insufficient, as we could have
44
+ // omp.parallel {
45
+ // omp.workshare {
46
+ // omp.parallel {
47
+ // hlfir.elemental {}
48
+ //
49
+ // Then this hlfir.elemental shall _not_ use the lowering for workshare
50
+ //
51
+ // Standard says:
52
+ // For a parallel construct, the construct is a unit of work with respect to
53
+ // the workshare construct. The statements contained in the parallel
54
+ // construct are executed by a new thread team.
55
+ //
56
+ // TODO similarly for single, critical, etc. Need to think through the
57
+ // patterns and implement this function.
58
+ //
59
+ return op->getParentOfType <omp::WorkshareOp>();
47
60
}
48
61
} // namespace flangomp
49
62
You can’t perform that action at this time.
0 commit comments