[SLPVectorizer] Moving Entry->NeedToGather check out of inner loop,

since it is invariant there. NFCI.

llvm-svn: 306749
This commit is contained in:
Dinar Temirbulatov
2017-06-29 21:56:33 +00:00
parent 346988bf02
commit f05c73c132

View File

@@ -1062,14 +1062,14 @@ void BoUpSLP::buildTree(ArrayRef<Value *> Roots,
for (TreeEntry &EIdx : VectorizableTree) {
TreeEntry *Entry = &EIdx;
// No need to handle users of gathered values.
if (Entry->NeedToGather)
continue;
// For each lane:
for (int Lane = 0, LE = Entry->Scalars.size(); Lane != LE; ++Lane) {
Value *Scalar = Entry->Scalars[Lane];
// No need to handle users of gathered values.
if (Entry->NeedToGather)
continue;
// Check if the scalar is externally used as an extra arg.
auto ExtI = ExternallyUsedValues.find(Scalar);
if (ExtI != ExternallyUsedValues.end()) {