File tree Expand file tree Collapse file tree 4 files changed +14
-13
lines changed
include/flang/Optimizer/Support
mlir/lib/Target/LLVMIR/Dialect/OpenMP Expand file tree Collapse file tree 4 files changed +14
-13
lines changed Original file line number Diff line number Diff line change @@ -200,11 +200,6 @@ std::optional<llvm::ArrayRef<int64_t>> getComponentLowerBoundsIfNonDefault(
200
200
fir::RecordType recordType, llvm::StringRef component,
201
201
mlir::ModuleOp module , const mlir::SymbolTable *symbolTable = nullptr );
202
202
203
- // Convert FIR type to LLVM without turning fir.box<T> into memory
204
- // reference.
205
- mlir::Type convertObjectType (const fir::LLVMTypeConverter &converter,
206
- mlir::Type firType);
207
-
208
203
// / Generate a LLVM constant value of type `ity`, using the provided offset.
209
204
mlir::LLVM::ConstantOp
210
205
genConstantIndex (mlir::Location loc, mlir::Type ity,
Original file line number Diff line number Diff line change @@ -127,6 +127,15 @@ struct PrivateClauseOpConversion
127
127
}
128
128
};
129
129
130
+ // Convert FIR type to LLVM without turning fir.box<T> into memory
131
+ // reference.
132
+ static mlir::Type convertObjectType (const fir::LLVMTypeConverter &converter,
133
+ mlir::Type firType) {
134
+ if (auto boxTy = mlir::dyn_cast<fir::BaseBoxType>(firType))
135
+ return converter.convertBoxTypeAsStruct (boxTy);
136
+ return converter.convertType (firType);
137
+ }
138
+
130
139
// FIR Op specific conversion for TargetAllocMemOp
131
140
struct TargetAllocMemOpConversion
132
141
: public OpenMPFIROpConversion<mlir::omp::TargetAllocMemOp> {
@@ -139,7 +148,7 @@ struct TargetAllocMemOpConversion
139
148
mlir::Location loc = allocmemOp.getLoc ();
140
149
auto ity = lowerTy ().indexType ();
141
150
mlir::Type dataTy = fir::unwrapRefType (heapTy);
142
- mlir::Type llvmObjectTy = fir:: convertObjectType (lowerTy (), dataTy);
151
+ mlir::Type llvmObjectTy = convertObjectType (lowerTy (), dataTy);
143
152
if (fir::isRecordWithTypeParameters (fir::unwrapSequenceType (dataTy)))
144
153
TODO (loc, " omp.target_allocmem codegen of derived type with length "
145
154
" parameters" );
Original file line number Diff line number Diff line change @@ -51,13 +51,6 @@ std::optional<llvm::ArrayRef<int64_t>> fir::getComponentLowerBoundsIfNonDefault(
51
51
return std::nullopt ;
52
52
}
53
53
54
- mlir::Type fir::convertObjectType (const fir::LLVMTypeConverter &converter,
55
- mlir::Type firType) {
56
- if (auto boxTy = mlir::dyn_cast<fir::BaseBoxType>(firType))
57
- return converter.convertBoxTypeAsStruct (boxTy);
58
- return converter.convertType (firType);
59
- }
60
-
61
54
mlir::LLVM::ConstantOp
62
55
fir::genConstantIndex (mlir::Location loc, mlir::Type ity,
63
56
mlir::ConversionPatternRewriter &rewriter,
Original file line number Diff line number Diff line change @@ -5835,6 +5835,10 @@ static bool isTargetDeviceOp(Operation *op) {
5835
5835
if (mlir::isa<omp::ThreadprivateOp>(op))
5836
5836
return true ;
5837
5837
5838
+ if (mlir::isa<omp::TargetAllocMemOp>(op) ||
5839
+ mlir::isa<mp::TargetFreeMemOp>(op))
5840
+ return true ;
5841
+
5838
5842
if (auto parentFn = op->getParentOfType <LLVM::LLVMFuncOp>())
5839
5843
if (auto declareTargetIface =
5840
5844
llvm::dyn_cast<mlir::omp::DeclareTargetInterface>(
You can’t perform that action at this time.
0 commit comments