aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/CodeGen/SelectionDAG/LegalizeIntegerTypes.cpp
diff options
context:
space:
mode:
authorCraig Topper <craig.topper@sifive.com>2024-04-19 12:38:53 -0700
committerGitHub <noreply@github.com>2024-04-19 12:38:53 -0700
commitce48f43f054f396fec50287cf8c7624bfaa5842a (patch)
tree2a3995f3eb9fad39f414300318a89ecdb180f5bc /llvm/lib/CodeGen/SelectionDAG/LegalizeIntegerTypes.cpp
parentadc11b34b1d7f99b3931f945073a652f0dec5aaf (diff)
downloadllvm-ce48f43f054f396fec50287cf8c7624bfaa5842a.zip
llvm-ce48f43f054f396fec50287cf8c7624bfaa5842a.tar.gz
llvm-ce48f43f054f396fec50287cf8c7624bfaa5842a.tar.bz2
[SelectionDAG] Require UADDO_CARRY carryin and carryout to have the same type. (#89255)
This requires type legalization to keep them the same. This means we no longer need to legalize the operand since it will be legalized when we legalize the second result.
Diffstat (limited to 'llvm/lib/CodeGen/SelectionDAG/LegalizeIntegerTypes.cpp')
-rw-r--r--llvm/lib/CodeGen/SelectionDAG/LegalizeIntegerTypes.cpp20
1 files changed, 1 insertions, 19 deletions
diff --git a/llvm/lib/CodeGen/SelectionDAG/LegalizeIntegerTypes.cpp b/llvm/lib/CodeGen/SelectionDAG/LegalizeIntegerTypes.cpp
index 93ce9c2..55f9737 100644
--- a/llvm/lib/CodeGen/SelectionDAG/LegalizeIntegerTypes.cpp
+++ b/llvm/lib/CodeGen/SelectionDAG/LegalizeIntegerTypes.cpp
@@ -949,7 +949,7 @@ SDValue DAGTypeLegalizer::PromoteIntRes_Overflow(SDNode *N) {
unsigned NumOps = N->getNumOperands();
assert(NumOps <= 3 && "Too many operands");
if (NumOps == 3)
- Ops[2] = N->getOperand(2);
+ Ops[2] = PromoteTargetBoolean(N->getOperand(2), VT);
SDLoc dl(N);
SDValue Res = DAG.getNode(N->getOpcode(), dl, DAG.getVTList(VT, SVT),
@@ -1867,11 +1867,6 @@ bool DAGTypeLegalizer::PromoteIntegerOperand(SDNode *N, unsigned OpNo) {
case ISD::FSHL:
case ISD::FSHR: Res = PromoteIntOp_FunnelShift(N); break;
- case ISD::SADDO_CARRY:
- case ISD::SSUBO_CARRY:
- case ISD::UADDO_CARRY:
- case ISD::USUBO_CARRY: Res = PromoteIntOp_ADDSUBO_CARRY(N, OpNo); break;
-
case ISD::FRAMEADDR:
case ISD::RETURNADDR: Res = PromoteIntOp_FRAMERETURNADDR(N); break;
@@ -2373,19 +2368,6 @@ SDValue DAGTypeLegalizer::PromoteIntOp_VP_ZERO_EXTEND(SDNode *N) {
N->getOperand(1), N->getOperand(2));
}
-SDValue DAGTypeLegalizer::PromoteIntOp_ADDSUBO_CARRY(SDNode *N, unsigned OpNo) {
- assert(OpNo == 2 && "Don't know how to promote this operand!");
-
- SDValue LHS = N->getOperand(0);
- SDValue RHS = N->getOperand(1);
- SDValue Carry = N->getOperand(2);
- SDLoc DL(N);
-
- Carry = PromoteTargetBoolean(Carry, LHS.getValueType());
-
- return SDValue(DAG.UpdateNodeOperands(N, LHS, RHS, Carry), 0);
-}
-
SDValue DAGTypeLegalizer::PromoteIntOp_FIX(SDNode *N) {
SDValue Op2 = ZExtPromotedInteger(N->getOperand(2));
return SDValue(