diff --git a/mlir/include/mlir/Dialect/LLVMIR/LLVMOps.td b/mlir/include/mlir/Dialect/LLVMIR/LLVMOps.td --- a/mlir/include/mlir/Dialect/LLVMIR/LLVMOps.td +++ b/mlir/include/mlir/Dialect/LLVMIR/LLVMOps.td @@ -1520,8 +1520,14 @@ /// is external, returns null. Region *getCallableRegion(); - /// Returns the callable result type, which is the function return type. - ArrayRef getCallableResults() { return getFunctionType().getReturnTypes(); } + /// Returns the callable result type, which is the single function return + /// type if it is not void, or an empty array if the function's return type + /// is void, as void is not assignable to a value. + ArrayRef getCallableResults() { + if (getFunctionType().getReturnType().isa()) + return {}; + return getFunctionType().getReturnTypes(); + } }];