diff --git a/mlir/include/mlir/IR/OperationSupport.h b/mlir/include/mlir/IR/OperationSupport.h --- a/mlir/include/mlir/IR/OperationSupport.h +++ b/mlir/include/mlir/IR/OperationSupport.h @@ -430,6 +430,14 @@ return lhs.getAsOpaquePointer() != rhs.getAsOpaquePointer(); } +inline bool operator==(OperationName lhs, StringRef rhs) { + return lhs.getStringRef() == rhs; +} + +inline bool operator!=(OperationName lhs, StringRef rhs) { + return lhs.getStringRef() != rhs; +} + // Make operation names hashable. inline llvm::hash_code hash_value(OperationName arg) { return llvm::hash_value(arg.getAsOpaquePointer());