Skip to content

Commit ca0613e

Browse files
committed
[LegalizeFloatTypes] Handle replacement for strict ops inside SoftPromoteHalfOp_FP_TO_XINT. NFC
Return SDValue() so we can notify the caller we did all replacements. Restore the getNumValues() == 1 check in the assert in the caller now that all handles only return nodes with a single result.
1 parent b89bb77 commit ca0613e

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

llvm/lib/CodeGen/SelectionDAG/LegalizeFloatTypes.cpp

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3474,7 +3474,7 @@ bool DAGTypeLegalizer::SoftPromoteHalfOperand(SDNode *N, unsigned OpNo) {
34743474

34753475
assert(Res.getNode() != N && "Expected a new node!");
34763476

3477-
assert(Res.getValueType() == N->getValueType(0) &&
3477+
assert(Res.getValueType() == N->getValueType(0) && N->getNumValues() == 1 &&
34783478
"Invalid operand expansion");
34793479

34803480
ReplaceValueWith(SDValue(N, 0), Res);
@@ -3544,7 +3544,8 @@ SDValue DAGTypeLegalizer::SoftPromoteHalfOp_FP_TO_XINT(SDNode *N) {
35443544
Op = DAG.getNode(N->getOpcode(), dl, {RVT, MVT::Other},
35453545
{Op.getValue(1), Op});
35463546
ReplaceValueWith(SDValue(N, 1), Op.getValue(1));
3547-
return Op;
3547+
ReplaceValueWith(SDValue(N, 0), Op);
3548+
return SDValue();
35483549
}
35493550

35503551
SDValue Res = DAG.getNode(GetPromotionOpcode(SVT, RVT), dl, NVT, Op);

0 commit comments

Comments
 (0)