Skip to content

Commit 071217c

Browse files
committed
ReduxWidth check for 0
Added assert to check for underflow of ReduxWidth modified: llvm/lib/Transforms/Vectorize/SLPVectorizer.cpp
1 parent 06edefa commit 071217c

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

llvm/lib/Transforms/Vectorize/SLPVectorizer.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20080,6 +20080,7 @@ class HorizontalReduction {
2008020080
NumRegs =
2008120081
TTI.getNumberOfRegisters(TTI.getRegisterClassForType(true, Tp));
2008220082
while (NumParts > NumRegs) {
20083+
assert(ReduxWidth > 0 && "ReduxWidth is unexpectedly 0.");
2008320084
ReduxWidth = bit_floor(ReduxWidth - 1);
2008420085
VectorType *Tp = getWidenedType(ScalarTy, ReduxWidth);
2008520086
NumParts = TTI.getNumberOfParts(Tp);

0 commit comments

Comments
 (0)