Skip to content

Commit b52c512

Browse files
authored
[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.
1 parent eedc2c8 commit b52c512

File tree

1 file changed

+0
-10
lines changed

1 file changed

+0
-10
lines changed

mlir/lib/Dialect/OpenMP/IR/OpenMPDialect.cpp

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -66,15 +66,6 @@ struct LLVMPointerPointerLikeModel
6666
LLVM::LLVMPointerType> {
6767
Type getElementType(Type pointer) const { return Type(); }
6868
};
69-
70-
struct OpenMPDialectFoldInterface : public DialectFoldInterface {
71-
using DialectFoldInterface::DialectFoldInterface;
72-
73-
bool shouldMaterializeInto(Region *region) const final {
74-
// Avoid folding constants across target regions
75-
return isa<TargetOp>(region->getParentOp());
76-
}
77-
};
7869
} // namespace
7970

8071
void OpenMPDialect::initialize() {
@@ -91,7 +82,6 @@ void OpenMPDialect::initialize() {
9182
#include "mlir/Dialect/OpenMP/OpenMPOpsTypes.cpp.inc"
9283
>();
9384

94-
addInterface<OpenMPDialectFoldInterface>();
9585
MemRefType::attachInterface<MemRefPointerLikeModel>(*getContext());
9686
LLVM::LLVMPointerType::attachInterface<LLVMPointerPointerLikeModel>(
9787
*getContext());

0 commit comments

Comments
 (0)