[llvm] [VectorCombine] fix division by zero in foldSelectShuffle (PR #156779)
Simon Pilgrim via llvm-commits
llvm-commits at lists.llvm.org
Thu Sep 4 05:10:08 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:
+1 an early-out seems the better approach.
https://github.com/llvm/llvm-project/pull/156779
More information about the llvm-commits
mailing list