|
26 | 26 | #include "flang/Optimizer/HLFIR/HLFIRDialect.h" |
27 | 27 | #include "flang/Optimizer/HLFIR/HLFIROps.h" |
28 | 28 | #include "flang/Optimizer/HLFIR/Passes.h" |
| 29 | +#include "flang/Optimizer/OpenMP/Passes.h" |
| 30 | +#include "mlir/Dialect/OpenMP/OpenMPDialect.h" |
29 | 31 | #include "mlir/IR/Dominance.h" |
30 | 32 | #include "mlir/IR/PatternMatch.h" |
31 | 33 | #include "mlir/Pass/Pass.h" |
32 | 34 | #include "mlir/Pass/PassManager.h" |
33 | 35 | #include "mlir/Transforms/DialectConversion.h" |
34 | | -#include "mlir/Dialect/OpenMP/OpenMPDialect.h" |
35 | 36 | #include "llvm/ADT/TypeSwitch.h" |
36 | 37 |
|
37 | 38 | namespace hlfir { |
@@ -792,7 +793,8 @@ struct ElementalOpConversion |
792 | 793 | // Generate a loop nest looping around the fir.elemental shape and clone |
793 | 794 | // fir.elemental region inside the inner loop. |
794 | 795 | hlfir::LoopNest loopNest = |
795 | | - hlfir::genLoopNest(loc, builder, extents, !elemental.isOrdered()); |
| 796 | + hlfir::genLoopNest(loc, builder, extents, !elemental.isOrdered(), |
| 797 | + flangomp::shouldUseWorkshareLowering(elemental)); |
796 | 798 | auto insPt = builder.saveInsertionPoint(); |
797 | 799 | builder.setInsertionPointToStart(loopNest.body); |
798 | 800 | auto yield = hlfir::inlineElementalOp(loc, builder, elemental, |
|
0 commit comments