diff --git a/mlir/include/mlir/IR/AttrTypeSubElements.h b/mlir/include/mlir/IR/AttrTypeSubElements.h --- a/mlir/include/mlir/IR/AttrTypeSubElements.h +++ b/mlir/include/mlir/IR/AttrTypeSubElements.h @@ -400,6 +400,12 @@ struct is_tuple : public std::false_type {}; template struct is_tuple> : public std::true_type {}; + +template +struct is_pair : public std::false_type {}; +template +struct is_pair> : public std::true_type {}; + template using has_get_method = decltype(T::get(std::declval()...)); template @@ -462,7 +468,8 @@ } else { // Functor used to build the replacement on success. auto buildReplacement = [&](auto newKey, MLIRContext *ctx) { - if constexpr (is_tuple::value) { + if constexpr (is_tuple::value || + is_pair::value) { return std::apply( [&](auto &&...params) { return constructSubElementReplacement(