[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
================
@@ -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);
----------------
jayfoad wrote:
You can make the early-out more generic:
```suggestion
Tmp = ComputeNumSignBits(PassThru, Depth + 1);
if (Tmp == 1)
return 1;
Tmp2 = ComputeNumSignBits(Vec, Depth + 1);
```
https://github.com/llvm/llvm-project/pull/159692
More information about the llvm-commits
mailing list