[llvm] [DAG] ComputeNumSignBits - subo_carry(x,x,c) -> bitwidth 'allsignbits' (PR #99935)

Craig Topper via llvm-commits llvm-commits at lists.llvm.org
Mon Jul 22 16:26:24 PDT 2024


================
@@ -4705,14 +4705,18 @@ unsigned SelectionDAG::ComputeNumSignBits(SDValue Op, const APInt &DemandedElts,
       return 1;  // Early out.
     Tmp2 = ComputeNumSignBits(Op.getOperand(1), DemandedElts, Depth + 1);
     return std::min(Tmp, Tmp2);
+  case ISD::SSUBO_CARRY:
+  case ISD::USUBO_CARRY:
+    // sub_carry(x,x,c) -> 0/-1 (sext carry)
+    if (Op.getResNo() == 0 && Op.getOperand(0) == Op.getOperand(1))
----------------
topperc wrote:

Do we need to check `getBooleanContents` here?

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


More information about the llvm-commits mailing list