File tree Expand file tree Collapse file tree 2 files changed +8
-5
lines changed
test/Transforms/DoConcurrent Expand file tree Collapse file tree 2 files changed +8
-5
lines changed Original file line number Diff line number Diff line change 2121#include " mlir/IR/IRMapping.h"
2222#include " mlir/Transforms/DialectConversion.h"
2323#include " mlir/Transforms/RegionUtils.h"
24+ #include " llvm/ADT/SmallPtrSet.h"
2425#include " llvm/Frontend/OpenMP/OMPConstants.h"
2526
2627namespace flangomp {
@@ -116,7 +117,7 @@ using InductionVariableInfos = llvm::SmallVector<InductionVariableInfo>;
116117void collectLoopLiveIns (fir::DoConcurrentLoopOp loop,
117118 llvm::SmallVectorImpl<mlir::Value> &liveIns) {
118119 llvm::SmallDenseSet<mlir::Value> seenValues;
119- llvm::SmallDenseSet <mlir::Operation *> seenOps;
120+ llvm::SmallPtrSet <mlir::Operation *, 8 > seenOps;
120121
121122 for (auto [lb, ub, st] : llvm::zip_equal (
122123 loop.getLowerBound (), loop.getUpperBound (), loop.getStep ())) {
@@ -426,6 +427,8 @@ class DoConcurrentConversion
426427 llvm::SmallVectorImpl<mlir::Value> &bounds) {
427428 populateBounds (var, bounds);
428429
430+ // Ensure that loop-nest bounds are evaluated in the host and forwarded to
431+ // the nested omp constructs when we map to the device.
429432 if (targetClauseOps)
430433 targetClauseOps->hostEvalVars .push_back (var);
431434 };
Original file line number Diff line number Diff line change @@ -11,10 +11,10 @@ program do_concurrent_basic
1111 integer :: a(10 )
1212 integer :: i
1313
14- ! CHECK-DAG : %[[I_ORIG_ALLOC:.*]] = fir.alloca i32 {bindc_name = "i"}
14+ ! CHECK: %[[I_ORIG_ALLOC:.*]] = fir.alloca i32 {bindc_name = "i"}
1515 ! CHECK: %[[I_ORIG_DECL:.*]]:2 = hlfir.declare %[[I_ORIG_ALLOC]]
1616
17- ! CHECK-DAG : %[[A_ADDR:.*]] = fir.address_of(@_QFEa)
17+ ! CHECK: %[[A_ADDR:.*]] = fir.address_of(@_QFEa)
1818 ! CHECK: %[[A_SHAPE:.*]] = fir.shape %[[A_EXTENT:.*]] : (index) -> !fir.shape<1>
1919 ! CHECK: %[[A_ORIG_DECL:.*]]:2 = hlfir.declare %[[A_ADDR]](%[[A_SHAPE]])
2020
@@ -26,15 +26,15 @@ program do_concurrent_basic
2626 ! CHECK: %[[HOST_UB:.*]] = fir.convert %[[C10]] : (i32) -> index
2727 ! CHECK: %[[HOST_STEP:.*]] = arith.constant 1 : index
2828
29- ! CHECK-DAG : %[[I_MAP_INFO:.*]] = omp.map.info var_ptr(%[[I_ORIG_DECL]]#1
29+ ! CHECK: %[[I_MAP_INFO:.*]] = omp.map.info var_ptr(%[[I_ORIG_DECL]]#1
3030 ! CHECK: %[[C0:.*]] = arith.constant 0 : index
3131 ! CHECK: %[[UPPER_BOUND:.*]] = arith.subi %[[A_EXTENT]], %{{c1.*}} : index
3232
3333 ! CHECK: %[[A_BOUNDS:.*]] = omp.map.bounds lower_bound(%[[C0]] : index)
3434 ! CHECK-SAME: upper_bound(%[[UPPER_BOUND]] : index)
3535 ! CHECK-SAME: extent(%[[A_EXTENT]] : index)
3636
37- ! CHECK-DAG : %[[A_MAP_INFO:.*]] = omp.map.info var_ptr(%[[A_ORIG_DECL]]#1 : {{[^(]+}})
37+ ! CHECK: %[[A_MAP_INFO:.*]] = omp.map.info var_ptr(%[[A_ORIG_DECL]]#1 : {{[^(]+}})
3838 ! CHECK-SAME: map_clauses(implicit, tofrom) capture(ByRef) bounds(%[[A_BOUNDS]])
3939
4040 ! CHECK: omp.target
You can’t perform that action at this time.
0 commit comments