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

Jay Foad via llvm-commits llvm-commits at lists.llvm.org
Fri Sep 19 02:04:34 PDT 2025


================
@@ -3480,6 +3481,26 @@ KnownBits SelectionDAG::computeKnownBits(SDValue Op, const APInt &DemandedElts,
         break;
     }
     break;
+  case ISD::VECTOR_COMPRESS: {
+    assert(!Op.getValueType().isScalableVector());
+
+    SDValue Vec = Op.getOperand(0);
+    SDValue PassThru = Op.getOperand(2);
+    // If PassThru is undefined, early out
+    if (PassThru.isUndef())
+      break;
----------------
jayfoad wrote:

I don't really see the need for this since if PassThru is undef then the first recursive call to computeKnownBits below should return quickly with all bits unknown.

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


More information about the llvm-commits mailing list