diff --git a/llvm/lib/Transforms/Utils/UnifyFunctionExitNodes.cpp b/llvm/lib/Transforms/Utils/UnifyFunctionExitNodes.cpp index f9aaa2366661..5d151ed70a0a 100644 --- a/llvm/lib/Transforms/Utils/UnifyFunctionExitNodes.cpp +++ b/llvm/lib/Transforms/Utils/UnifyFunctionExitNodes.cpp @@ -50,6 +50,11 @@ bool UnifyFunctionExitNodes::runOnFunction(Function &F) { // Loop over all of the blocks in a function, tracking all of the blocks that // return. // + + // PHINode can not handle aggregates returned by multiple value ret + // instructions. TODO: Handle each return value independently. + if (isa(F.getReturnType())) + return false; std::vector ReturningBlocks; std::vector UnwindingBlocks; std::vector UnreachableBlocks;