File tree Expand file tree Collapse file tree 2 files changed +21
-3
lines changed Expand file tree Collapse file tree 2 files changed +21
-3
lines changed Original file line number Diff line number Diff line change @@ -252,7 +252,8 @@ mlir::Block *fir::FirOpBuilder::getAllocaBlock() {
252
252
.getParentOfType <mlir::omp::OutlineableOpenMPOpInterface>()) {
253
253
return ompOutlineableIface.getAllocaBlock ();
254
254
}
255
- if (getRegion ().getParentOfType <mlir::omp::DeclareReductionOp>())
255
+ if (getRegion ().getParentOfType <mlir::omp::DeclareReductionOp>() ||
256
+ getRegion ().getParentOfType <mlir::omp::PrivateClauseOp>())
256
257
return &getRegion ().front ();
257
258
if (auto accRecipeIface =
258
259
getRegion ().getParentOfType <mlir::acc::RecipeInterface>()) {
Original file line number Diff line number Diff line change 1
1
! Test delayed privatization for allocatables: `firstprivate`.
2
2
3
+ ! RUN: split-file %s %t
4
+
3
5
! RUN: %flang_fc1 -emit-hlfir -fopenmp -mmlir --openmp-enable-delayed-privatization \
4
- ! RUN: -o - %s 2>&1 | FileCheck %s
5
- ! RUN: bbc -emit-hlfir -fopenmp --openmp-enable-delayed-privatization -o - %s 2>&1 |\
6
+ ! RUN: -o - %t/test_ir.f90 2>&1 | FileCheck %s
7
+ ! RUN: bbc -emit-hlfir -fopenmp --openmp-enable-delayed-privatization -o - %t/test_ir.f90 2>&1 |\
6
8
! RUN: FileCheck %s
7
9
10
+ !- -- test_ir.f90
8
11
subroutine delayed_privatization_allocatable
9
12
implicit none
10
13
integer , allocatable :: var1
@@ -34,3 +37,17 @@ subroutine delayed_privatization_allocatable
34
37
! CHECK-NEXT: %[[ORIG_BASE_LD:.*]] = fir.load %[[ORIG_BASE_ADDR]]
35
38
! CHECK-NEXT: hlfir.assign %[[ORIG_BASE_LD]] to %[[PRIV_BASE_BOX]] temporary_lhs
36
39
! CHECK-NEXT: }
40
+
41
+ ! RUN: %flang -fopenmp -mmlir --openmp-enable-delayed-privatization \
42
+ ! RUN: -o - %t/test_compilation_to_obj.f90
43
+
44
+ !- -- test_compilation_to_obj.f90
45
+
46
+ program compilation_to_obj
47
+ real , allocatable :: t(:)
48
+
49
+ ! $omp parallel firstprivate(t)
50
+ t(1 ) = 3.14
51
+ ! $omp end parallel
52
+
53
+ end program compilation_to_obj
You can’t perform that action at this time.
0 commit comments