diff --git a/llvm/lib/CodeGen/SelectionDAG/LegalizeVectorOps.cpp b/llvm/lib/CodeGen/SelectionDAG/LegalizeVectorOps.cpp index 17618d713055..f76f3340535e 100644 --- a/llvm/lib/CodeGen/SelectionDAG/LegalizeVectorOps.cpp +++ b/llvm/lib/CodeGen/SelectionDAG/LegalizeVectorOps.cpp @@ -1177,7 +1177,7 @@ SDValue VectorLegalizer::ExpandStrictFPOp(SDValue Op) { AddLegalizedOperand(Op.getValue(0), Result); AddLegalizedOperand(Op.getValue(1), NewChain); - return NewChain; + return Op.getResNo() ? NewChain : Result; } SDValue VectorLegalizer::UnrollVSETCC(SDValue Op) {