diff --git a/mlir/lib/IR/FunctionSupport.cpp b/mlir/lib/IR/FunctionSupport.cpp --- a/mlir/lib/IR/FunctionSupport.cpp +++ b/mlir/lib/IR/FunctionSupport.cpp @@ -40,7 +40,7 @@ ArrayAttr attrs = op->getAttrOfType(getArgDictAttrName()); DictionaryAttr argAttrs = attrs ? attrs[index].cast() : DictionaryAttr(); - return (argAttrs && !argAttrs.empty()) ? argAttrs : DictionaryAttr(); + return argAttrs; } DictionaryAttr mlir::function_like_impl::getResultAttrDict(Operation *op, @@ -48,7 +48,7 @@ ArrayAttr attrs = op->getAttrOfType(getResultDictAttrName()); DictionaryAttr resAttrs = attrs ? attrs[index].cast() : DictionaryAttr(); - return (resAttrs && !resAttrs.empty()) ? resAttrs : DictionaryAttr(); + return resAttrs; } void mlir::function_like_impl::detail::setArgResAttrDict(