Skip to content

Commit 0716805

Browse files
committed
[SLP] optimizeGatherSequence - assert every Instruction in the worklist is non-null.
Fixes clang static analyzer warning.
1 parent 750b3dd commit 0716805

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

llvm/lib/Transforms/Vectorize/SLPVectorizer.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4919,7 +4919,8 @@ void BoUpSLP::optimizeGatherSequence() {
49194919
// instructions into different buckets based on the insert lane.
49204920
SmallVector<Instruction *, 16> Visited;
49214921
for (auto I = CSEWorkList.begin(), E = CSEWorkList.end(); I != E; ++I) {
4922-
assert((I == CSEWorkList.begin() || !DT->dominates(*I, *std::prev(I))) &&
4922+
assert(*I &&
4923+
(I == CSEWorkList.begin() || !DT->dominates(*I, *std::prev(I))) &&
49234924
"Worklist not sorted properly!");
49244925
BasicBlock *BB = (*I)->getBlock();
49254926
// For all instructions in blocks containing gather sequences:

0 commit comments

Comments
 (0)