llvm / llvm-project

The LLVM Project is a collection of modular and reusable compiler and toolchain technologies.
http://llvm.org
Other
28.91k stars 11.94k forks source link

SLPVectorizer.cpp : Conditional Check for Idx Might Prevent TryToVectorize(Set.second) Execution in vectorizeStores() #107199

Open Bruce0316 opened 2 months ago

Bruce0316 commented 2 months ago

In llvm-project/llvm/lib/Transforms/Vectorize/SLPVectorizer.cpp, at line 16324, auto It = Set.second.find(std::make_pair(Idx, *Diff)); The comment explains that if *Diff is duplicated in the set, TryToVectorize(Set.second) should be executed. However, the code also checks Idx. Does this mean that TryToVectorize(Set.second) might never be executed?

alexey-bataev commented 2 months ago

It will be attempted in the code after // Final vectorization attempt.