File tree Expand file tree Collapse file tree 2 files changed +20
-1
lines changed Expand file tree Collapse file tree 2 files changed +20
-1
lines changed Original file line number Diff line number Diff line change @@ -225,7 +225,7 @@ void DataSharingProcessor::insertLastPrivateCompare(mlir::Operation *op) {
225
225
auto ifOp = firOpBuilder.create <fir::IfOp>(loc, cmpOp, /* else*/ false );
226
226
firOpBuilder.setInsertionPointToStart (&ifOp.getThenRegion ().front ());
227
227
assert (loopIV && " loopIV was not set" );
228
- firOpBuilder.create <fir::StoreOp>(loopOp. getLoc () , v, loopIV);
228
+ firOpBuilder.createStoreWithConvert (loc , v, loopIV);
229
229
lastPrivIP = firOpBuilder.saveInsertionPoint ();
230
230
} else if (mlir::isa<mlir::omp::SectionsOp>(op)) {
231
231
// Already handled by genOMP()
Original file line number Diff line number Diff line change @@ -70,3 +70,22 @@ subroutine lastprivate_iv_dec()
70
70
end do
71
71
! $omp end do
72
72
end subroutine
73
+
74
+
75
+ ! CHECK-LABEL: @_QPlastprivate_iv_i1
76
+ subroutine lastprivate_iv_i1
77
+ integer * 1 :: i1
78
+ i1= 0
79
+ ! CHECK: omp.wsloop
80
+ ! CHECK: omp.loop_nest
81
+ ! CHECK: fir.if %{{.*}} {
82
+ ! CHECK: %[[I8_VAL:.*]] = fir.convert %{{.*}} : (i32) -> i8
83
+ ! CHECK: fir.store %[[I8_VAL]] to %[[IV:.*]]#1 : !fir.ref<i8>
84
+ ! CHECK: %[[IV_VAL:.*]] = fir.load %[[IV]]#0 : !fir.ref<i8>
85
+ ! CHECK: hlfir.assign %[[IV_VAL]] to %{{.*}}#0 temporary_lhs : i8, !fir.ref<i8>
86
+ ! CHECK: }
87
+ ! $omp do lastprivate(i1)
88
+ do i1= 1 ,8
89
+ enddo
90
+ ! $omp end do
91
+ end subroutine
You can’t perform that action at this time.
0 commit comments