[llvm] [SelectionDAG] Prevent combination on inconsistent type in `combineCarryDiamond` (PR #84888)

Matt Arsenault via llvm-commits llvm-commits at lists.llvm.org
Tue Mar 12 10:19:49 PDT 2024


================
@@ -3442,6 +3442,9 @@ static SDValue combineCarryDiamond(SelectionDAG &DAG, const TargetLowering &TLI,
     return SDValue();
   if (Opcode != ISD::UADDO && Opcode != ISD::USUBO)
     return SDValue();
+  // Guarantee identical type of CarryOut
+  if (N->getValueType(0) != Carry0.getValue(1).getValueType())
----------------
arsenm wrote:

I don't see how this is implicitly assuming i1? I can see implicitly assuming the uaddo output and input bools are the same 

https://github.com/llvm/llvm-project/pull/84888


More information about the llvm-commits mailing list