[MLIR][OpenMP] Remove OpenMPDialectFoldInterface (#97577)

The `OpenMPDialectFoldInterface` was originally introduced to prevent
constants from being hoisted out of `omp.target` regions. This hasn't
been necessary since the `IsolatedFromAbove` trait was added to that
operation, so it's safe to remove this interface.
This commit is contained in:
Sergio Afonso
2024-07-05 11:26:32 +01:00
committed by GitHub
parent eedc2c8cb2
commit b52c512ff0

View File

@@ -66,15 +66,6 @@ struct LLVMPointerPointerLikeModel
LLVM::LLVMPointerType> {
Type getElementType(Type pointer) const { return Type(); }
};
struct OpenMPDialectFoldInterface : public DialectFoldInterface {
using DialectFoldInterface::DialectFoldInterface;
bool shouldMaterializeInto(Region *region) const final {
// Avoid folding constants across target regions
return isa<TargetOp>(region->getParentOp());
}
};
} // namespace
void OpenMPDialect::initialize() {
@@ -91,7 +82,6 @@ void OpenMPDialect::initialize() {
#include "mlir/Dialect/OpenMP/OpenMPOpsTypes.cpp.inc"
>();
addInterface<OpenMPDialectFoldInterface>();
MemRefType::attachInterface<MemRefPointerLikeModel>(*getContext());
LLVM::LLVMPointerType::attachInterface<LLVMPointerPointerLikeModel>(
*getContext());