[Mlir-commits] [mlir] b52c512 - [MLIR][OpenMP] Remove OpenMPDialectFoldInterface (#97577)

llvmlistbot at llvm.org llvmlistbot at llvm.org
Fri Jul 5 03:26:35 PDT 2024


Author: Sergio Afonso
Date: 2024-07-05T11:26:32+01:00
New Revision: b52c512ff033e2876f1f4b5a4da8c27a9f1bbd87

URL: https://github.com/llvm/llvm-project/commit/b52c512ff033e2876f1f4b5a4da8c27a9f1bbd87
DIFF: https://github.com/llvm/llvm-project/commit/b52c512ff033e2876f1f4b5a4da8c27a9f1bbd87.diff

LOG: [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.

Added: 
    

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

Removed: 
    


################################################################################
diff  --git a/mlir/lib/Dialect/OpenMP/IR/OpenMPDialect.cpp b/mlir/lib/Dialect/OpenMP/IR/OpenMPDialect.cpp
index 23f291bfc22329..a7a0af231af33e 100644
--- a/mlir/lib/Dialect/OpenMP/IR/OpenMPDialect.cpp
+++ b/mlir/lib/Dialect/OpenMP/IR/OpenMPDialect.cpp
@@ -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());


        


More information about the Mlir-commits mailing list