[llvm] [LLVM][CodeGen] Ensure optimizeIncrementingWhile only accepts scalable vectors. (PR #148351)

Ricardo Jesus via llvm-commits llvm-commits at lists.llvm.org
Sun Jul 13 02:41:13 PDT 2025


================
@@ -5509,7 +5509,8 @@ static SDValue optimizeIncrementingWhile(SDNode *N, SelectionDAG &DAG,
   unsigned Op0 = N->getOpcode() == ISD::INTRINSIC_WO_CHAIN ? 1 : 0;
   unsigned Op1 = N->getOpcode() == ISD::INTRINSIC_WO_CHAIN ? 2 : 1;
 
-  if (!isa<ConstantSDNode>(N->getOperand(Op1)))
+  if (!N->getValueType(0).isScalableVector() ||
----------------
rj-jesus wrote:

Indeed, that's a good point. I had in mind we still leave an assert here to make it clear that fixed length vectors are currently unsupported, but bailing out is also good.

I was thinking of a scenario where this could get used elsewhere at some point for fixed length vectors with IsEqual set to true, but we can revisit it if that ever happens.

Thanks very much for fixing this. :)


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


More information about the llvm-commits mailing list