This patch defines `fir::SafeTempArrayCopyAttrInterface` and the corresponding OpenACC/OpenMP related attributes in FIR dialect. The actual implementations are just placeholders right now, and array repacking becomes a no-op if `-fopenacc/-fopenmp` is used for the compilation.
39 lines
1.5 KiB
C++
39 lines
1.5 KiB
C++
//===-- RegisterOpenACCExtensions.cpp -------------------------------------===//
|
|
//
|
|
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
|
|
// See https://llvm.org/LICENSE.txt for license information.
|
|
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
|
|
//
|
|
//===----------------------------------------------------------------------===//
|
|
//
|
|
// Registration for OpenACC extensions as applied to FIR dialect.
|
|
//
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
#include "flang/Optimizer/OpenACC/RegisterOpenACCExtensions.h"
|
|
#include "flang/Optimizer/Dialect/FIRDialect.h"
|
|
#include "flang/Optimizer/Dialect/FIRType.h"
|
|
#include "flang/Optimizer/OpenACC/FIROpenACCTypeInterfaces.h"
|
|
|
|
namespace fir::acc {
|
|
void registerOpenACCExtensions(mlir::DialectRegistry ®istry) {
|
|
registry.addExtension(+[](mlir::MLIRContext *ctx,
|
|
fir::FIROpsDialect *dialect) {
|
|
fir::SequenceType::attachInterface<OpenACCMappableModel<fir::SequenceType>>(
|
|
*ctx);
|
|
fir::BoxType::attachInterface<OpenACCMappableModel<fir::BaseBoxType>>(*ctx);
|
|
|
|
fir::ReferenceType::attachInterface<
|
|
OpenACCPointerLikeModel<fir::ReferenceType>>(*ctx);
|
|
fir::PointerType::attachInterface<
|
|
OpenACCPointerLikeModel<fir::PointerType>>(*ctx);
|
|
fir::HeapType::attachInterface<OpenACCPointerLikeModel<fir::HeapType>>(
|
|
*ctx);
|
|
fir::LLVMPointerType::attachInterface<
|
|
OpenACCPointerLikeModel<fir::LLVMPointerType>>(*ctx);
|
|
});
|
|
registerAttrsExtensions(registry);
|
|
}
|
|
|
|
} // namespace fir::acc
|