diff --git a/mlir/include/mlir/IR/Value.h b/mlir/include/mlir/IR/Value.h --- a/mlir/include/mlir/IR/Value.h +++ b/mlir/include/mlir/IR/Value.h @@ -489,6 +489,17 @@ return reinterpret_cast(pointer); } }; +template <> +struct DenseMapInfo : public DenseMapInfo { + static mlir::OpResult getEmptyKey() { + void *pointer = llvm::DenseMapInfo::getEmptyKey(); + return reinterpret_cast(pointer); + } + static mlir::OpResult getTombstoneKey() { + void *pointer = llvm::DenseMapInfo::getTombstoneKey(); + return reinterpret_cast(pointer); + } +}; /// Allow stealing the low bits of a value. template <> @@ -513,6 +524,14 @@ return reinterpret_cast(pointer); } }; +template <> +struct PointerLikeTypeTraits + : public PointerLikeTypeTraits { +public: + static inline mlir::OpResult getFromVoidPointer(void *pointer) { + return reinterpret_cast(pointer); + } +}; } // end namespace llvm