@@ -142,8 +142,8 @@ static mlir::LLVM::LLVMFuncOp getOmpTargetAlloc(mlir::Operation *op) {
142142 /* isVarArg=*/ false ));
143143}
144144
145- static mlir::Type
146- convertObjectType ( const fir::LLVMTypeConverter &converter, mlir::Type firType) {
145+ static mlir::Type convertObjectType ( const fir::LLVMTypeConverter &converter,
146+ mlir::Type firType) {
147147 if (auto boxTy = mlir::dyn_cast<fir::BaseBoxType>(firType))
148148 return converter.convertBoxTypeAsStruct (boxTy);
149149 return converter.convertType (firType);
@@ -189,8 +189,9 @@ computeElementDistance(mlir::Location loc, mlir::Type llvmObjectType,
189189}
190190
191191static mlir::Value genTypeSizeInBytes (mlir::Location loc, mlir::Type idxTy,
192- mlir::ConversionPatternRewriter &rewriter,
193- mlir::Type llTy, const mlir::DataLayout &dataLayout) {
192+ mlir::ConversionPatternRewriter &rewriter,
193+ mlir::Type llTy,
194+ const mlir::DataLayout &dataLayout) {
194195 return computeElementDistance (loc, llTy, idxTy, rewriter, dataLayout);
195196}
196197
@@ -224,8 +225,10 @@ genAllocationScaleSize(OP op, mlir::Type ity,
224225}
225226
226227static mlir::Value integerCast (const fir::LLVMTypeConverter &converter,
227- mlir::Location loc, mlir::ConversionPatternRewriter &rewriter,
228- mlir::Type ty, mlir::Value val, bool fold = false ) {
228+ mlir::Location loc,
229+ mlir::ConversionPatternRewriter &rewriter,
230+ mlir::Type ty, mlir::Value val,
231+ bool fold = false ) {
229232 auto valTy = val.getType ();
230233 // If the value was not yet lowered, lower its type so that it can
231234 // be used in getPrimitiveTypeSizeInBits.
@@ -261,11 +264,13 @@ struct TargetAllocMemOpConversion
261264 auto ity = lowerTy ().indexType ();
262265 mlir::Type dataTy = fir::unwrapRefType (heapTy);
263266 mlir::Type llvmObjectTy = convertObjectType (lowerTy (), dataTy);
264- mlir::Type llvmPtrTy = mlir::LLVM::LLVMPointerType::get (allocmemOp.getContext (), 0 );
267+ mlir::Type llvmPtrTy =
268+ mlir::LLVM::LLVMPointerType::get (allocmemOp.getContext (), 0 );
265269 if (fir::isRecordWithTypeParameters (fir::unwrapSequenceType (dataTy)))
266270 TODO (loc, " omp.target_allocmem codegen of derived type with length "
267271 " parameters" );
268- mlir::Value size = genTypeSizeInBytes (loc, ity, rewriter, llvmObjectTy, lowerTy ().getDataLayout ());
272+ mlir::Value size = genTypeSizeInBytes (loc, ity, rewriter, llvmObjectTy,
273+ lowerTy ().getDataLayout ());
269274 if (auto scaleSize = genAllocationScaleSize (allocmemOp, ity, rewriter))
270275 size = rewriter.create <mlir::LLVM::MulOp>(loc, ity, size, scaleSize);
271276 for (mlir::Value opnd : adaptor.getOperands ().drop_front ())
@@ -281,7 +286,8 @@ struct TargetAllocMemOpConversion
281286 loc, llvmPtrTy,
282287 mlir::SmallVector<mlir::Value, 2 >({size, allocmemOp.getDevice ()}),
283288 addLLVMOpBundleAttrs (rewriter, allocmemOp->getAttrs (), 2 ));
284- rewriter.replaceOpWithNewOp <mlir::LLVM::PtrToIntOp>(allocmemOp, rewriter.getIntegerType (64 ), callOp.getResult ());
289+ rewriter.replaceOpWithNewOp <mlir::LLVM::PtrToIntOp>(
290+ allocmemOp, rewriter.getIntegerType (64 ), callOp.getResult ());
285291 return mlir::success ();
286292 }
287293};
0 commit comments