[llvm] [VectorCombine] fix division by zero in foldSelectShuffle (PR #156779)

Simon Pilgrim via llvm-commits llvm-commits at lists.llvm.org
Mon Sep 8 04:39:28 PDT 2025


================
@@ -3900,7 +3900,8 @@ bool VectorCombine::foldSelectShuffle(Instruction &I, bool FromReduction) {
   unsigned ElementSize = VT->getElementType()->getPrimitiveSizeInBits();
   unsigned MaxVectorSize =
       TTI.getRegisterBitWidth(TargetTransformInfo::RGK_FixedWidthVector);
-  unsigned MaxElementsInVector = MaxVectorSize / ElementSize;
+  unsigned MaxElementsInVector =
----------------
RKSimon wrote:

I'm sorry but I'd completely forgotten about this patch - I've raised #157430 with an early-out to handle a separate reported issue with the same cause.

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


More information about the llvm-commits mailing list