[Mlir-commits] [mlir] 0cabe38 - [mlir][NFC] Use fully qualified C++ namespaces in .td files.

Vladislav Vinogradov llvmlistbot at llvm.org
Thu Feb 9 04:29:05 PST 2023


Author: Vladislav Vinogradov
Date: 2023-02-09T15:28:50+03:00
New Revision: 0cabe38b2d98afde09917eeca81840fca5f3ce29

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

LOG: [mlir][NFC] Use fully qualified C++ namespaces in .td files.

Some extra cases that were not covered in 6da0184b.

Reviewed By: springerm

Differential Revision: https://reviews.llvm.org/D143477

Added: 
    

Modified: 
    mlir/include/mlir/Dialect/Bufferization/IR/BufferizableOpInterface.td
    mlir/include/mlir/Interfaces/SideEffectInterfaceBase.td

Removed: 
    


################################################################################
diff  --git a/mlir/include/mlir/Dialect/Bufferization/IR/BufferizableOpInterface.td b/mlir/include/mlir/Dialect/Bufferization/IR/BufferizableOpInterface.td
index 8ba8a37747176..6e796c8aebb0a 100644
--- a/mlir/include/mlir/Dialect/Bufferization/IR/BufferizableOpInterface.td
+++ b/mlir/include/mlir/Dialect/Bufferization/IR/BufferizableOpInterface.td
@@ -146,7 +146,7 @@ def BufferizableOpInterface : OpInterface<"BufferizableOpInterface"> {
         /*defaultImplementation=*/[{
           assert(opResult.getDefiningOp() == $_op.getOperation() &&
                  "invalid OpResult");
-          return bufferization::detail::defaultResultBufferizesToMemoryWrite(
+          return ::mlir::bufferization::detail::defaultResultBufferizesToMemoryWrite(
               opResult, state);
         }]
       >,
@@ -167,7 +167,7 @@ def BufferizableOpInterface : OpInterface<"BufferizableOpInterface"> {
                       "const ::mlir::bufferization::AnalysisState &":$state),
         /*methodBody=*/"",
         /*defaultImplementation=*/[{
-          return opOperand.get().getType().isa<UnrankedTensorType>();
+          return opOperand.get().getType().isa<::mlir::UnrankedTensorType>();
         }]
       >,
       InterfaceMethod<
@@ -234,7 +234,7 @@ def BufferizableOpInterface : OpInterface<"BufferizableOpInterface"> {
         /*methodBody=*/"",
         /*defaultImplementation=*/[{
           // Does not have to be implemented for ops without tensor OpOperands.
-          assert(opOperand.get().getType().isa<TensorType>() &&
+          assert(opOperand.get().getType().isa<::mlir::TensorType>() &&
                  "expected OpOperand with tensor type");
           llvm_unreachable("getAliasingOpResults not implemented");
         }]
@@ -305,7 +305,7 @@ def BufferizableOpInterface : OpInterface<"BufferizableOpInterface"> {
                       "const ::mlir::bufferization::AnalysisState &":$state),
         /*methodBody=*/"",
         /*defaultImplementation=*/[{
-          assert(opResult.getType().isa<TensorType>() &&
+          assert(opResult.getType().isa<::mlir::TensorType>() &&
                  "expected OpResult with tensor type");
           return ::mlir::bufferization::detail::defaultGetAliasingOpOperands(
               opResult, state);
@@ -332,7 +332,7 @@ def BufferizableOpInterface : OpInterface<"BufferizableOpInterface"> {
         /*methodBody=*/"",
         /*defaultImplementation=*/[{
           auto bufferizableOp =
-              cast<BufferizableOpInterface>($_op.getOperation());
+              ::llvm::cast<BufferizableOpInterface>($_op.getOperation());
           return bufferizableOp.resolveTensorOpOperandConflicts(
               rewriter, state);
         }]
@@ -370,7 +370,7 @@ def BufferizableOpInterface : OpInterface<"BufferizableOpInterface"> {
         /*methodBody=*/"",
         /*defaultImplementation=*/[{
           llvm_unreachable("bufferize not implemented");
-          return failure();
+          return ::mlir::failure();
         }]
       >,
       InterfaceMethod<
@@ -395,7 +395,7 @@ def BufferizableOpInterface : OpInterface<"BufferizableOpInterface"> {
                       "const ::mlir::bufferization::AnalysisState &":$state),
         /*methodBody=*/"",
         /*defaultImplementation=*/[{
-          return value.isa<OpResult>();
+          return value.isa<::mlir::OpResult>();
         }]
       >,
       InterfaceMethod<
@@ -435,7 +435,7 @@ def BufferizableOpInterface : OpInterface<"BufferizableOpInterface"> {
         /*args=*/(ins "const ::mlir::bufferization::AnalysisState &":$state),
         /*methodBody=*/"",
         /*defaultImplementation=*/[{
-          return success();
+          return ::mlir::success();
         }]
       >,
       InterfaceMethod<
@@ -456,7 +456,7 @@ def BufferizableOpInterface : OpInterface<"BufferizableOpInterface"> {
         /*defaultImplementation=*/[{
           assert(getOwnerOfValue(value) == $_op.getOperation() &&
                  "expected that value belongs to this op");
-          return bufferization::detail::defaultGetBufferType(
+          return ::mlir::bufferization::detail::defaultGetBufferType(
               value, options, fixedTypes);
         }]
       >,
@@ -480,7 +480,7 @@ def BufferizableOpInterface : OpInterface<"BufferizableOpInterface"> {
         /*methodBody=*/"",
         /*defaultImplementation=*/[{
           return ::mlir::bufferization::detail::defaultIsRepetitiveRegion(
-              cast<BufferizableOpInterface>($_op.getOperation()), index);
+              ::llvm::cast<BufferizableOpInterface>($_op.getOperation()), index);
         }]
       >
   ];
@@ -502,7 +502,7 @@ def BufferizableOpInterface : OpInterface<"BufferizableOpInterface"> {
         ::mlir::OpOperand &opOperand,
         const ::mlir::bufferization::AnalysisState &state) {
       auto bufferizableOp =
-          cast<::mlir::bufferization::BufferizableOpInterface>(getOperation());
+          ::llvm::cast<::mlir::bufferization::BufferizableOpInterface>(getOperation());
       return !bufferizableOp.bufferizesToMemoryRead(opOperand, state)
           && !bufferizableOp.bufferizesToMemoryWrite(opOperand, state)
           && bufferizableOp.getAliasingOpResults(opOperand, state)

diff  --git a/mlir/include/mlir/Interfaces/SideEffectInterfaceBase.td b/mlir/include/mlir/Interfaces/SideEffectInterfaceBase.td
index 15c58ab274c45..8b8904b3c5a3f 100644
--- a/mlir/include/mlir/Interfaces/SideEffectInterfaceBase.td
+++ b/mlir/include/mlir/Interfaces/SideEffectInterfaceBase.td
@@ -85,7 +85,7 @@ class EffectOpInterfaceBase<string name, string baseEffect>
                                             }] # baseEffect # [{>, 4> effects;
       getEffects(effects);
       return !effects.empty() && ::llvm::all_of(effects, [](const auto &it) {
-        return isa<Effect>(it.getEffect());
+        return ::llvm::isa<Effect>(it.getEffect());
       });
     }
 
@@ -115,7 +115,7 @@ class EffectOpInterfaceBase<string name, string baseEffect>
               }] # baseEffect # [{>, 4> effects;
       getEffects(effects);
       auto it = ::llvm::find_if(effects, [&](auto &it) {
-        return isa<Effect>(it.getEffect()) && it.getValue() == value;
+        return ::llvm::isa<Effect>(it.getEffect()) && it.getValue() == value;
       });
       if (it == effects.end())
         return std::nullopt;


        


More information about the Mlir-commits mailing list