[llvm] added ISD::VECTOR_COMPRESS handling in computeKnownBits/ComputeNumSign… (PR #159692)

Simon Pilgrim via llvm-commits llvm-commits at lists.llvm.org
Fri Sep 19 02:46:09 PDT 2025


================
@@ -4792,6 +4813,19 @@ unsigned SelectionDAG::ComputeNumSignBits(SDValue Op, const APInt &DemandedElts,
     }
     return Tmp;
 
+  case ISD::VECTOR_COMPRESS: {
+    SDValue Vec = Op.getOperand(0);
+    SDValue Mask = Op.getOperand(1);
+    SDValue PassThru = Op.getOperand(2);
+    // If PassThru is undefined, early out.
+    if (PassThru.isUndef())
+      return 1;
+    Tmp = ComputeNumSignBits(Vec, Depth + 1);
+    Tmp2 = ComputeNumSignBits(PassThru, Depth + 1);
----------------
RKSimon wrote:

Again - we might be able to use DemandedElts for the PassThru signbits calc

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


More information about the llvm-commits mailing list