|
11 | 11 | //===----------------------------------------------------------------------===// |
12 | 12 |
|
13 | 13 | #include "flang/Lower/Bridge.h" |
| 14 | +#include "DirectivesCommon.h" |
14 | 15 | #include "flang/Common/Version.h" |
15 | 16 | #include "flang/Lower/Allocatable.h" |
16 | 17 | #include "flang/Lower/CallInterface.h" |
@@ -2999,14 +3000,19 @@ class FirConverter : public Fortran::lower::AbstractConverter { |
2999 | 3000 | mlir::Block &b = op.getRegion().back(); |
3000 | 3001 | builder->setInsertionPointToStart(&b); |
3001 | 3002 |
|
| 3003 | + Fortran::lower::pft::Evaluation *crtEval = &getEval(); |
| 3004 | + if (crtEval->lowerAsUnstructured()) |
| 3005 | + Fortran::lower::createEmptyRegionBlocks<fir::FirEndOp>( |
| 3006 | + *builder, crtEval->getNestedEvaluations()); |
| 3007 | + builder->setInsertionPointToStart(&b); |
| 3008 | + |
3002 | 3009 | for (auto [arg, value] : llvm::zip( |
3003 | 3010 | op.getLoopRegions().front()->front().getArguments(), ivValues)) { |
3004 | 3011 | mlir::Value convArg = |
3005 | 3012 | builder->createConvert(loc, fir::unwrapRefType(value.getType()), arg); |
3006 | 3013 | builder->create<fir::StoreOp>(loc, convArg, value); |
3007 | 3014 | } |
3008 | 3015 |
|
3009 | | - Fortran::lower::pft::Evaluation *crtEval = &getEval(); |
3010 | 3016 | if (crtEval->lowerAsStructured()) { |
3011 | 3017 | crtEval = &crtEval->getFirstNestedEvaluation(); |
3012 | 3018 | for (int64_t i = 1; i < nestedLoops; i++) |
|
0 commit comments