[llvm] r297361 - [SLP] Mark values in Dot that need to be extracted
Adam Nemet via llvm-commits
llvm-commits at lists.llvm.org
Wed Mar 8 21:48:03 PST 2017
Author: anemet
Date: Wed Mar 8 23:48:03 2017
New Revision: 297361
URL: http://llvm.org/viewvc/llvm-project?rev=297361&view=rev
Log:
[SLP] Mark values in Dot that need to be extracted
Modified:
llvm/trunk/lib/Transforms/Vectorize/SLPVectorizer.cpp
Modified: llvm/trunk/lib/Transforms/Vectorize/SLPVectorizer.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Vectorize/SLPVectorizer.cpp?rev=297361&r1=297360&r2=297361&view=diff
==============================================================================
--- llvm/trunk/lib/Transforms/Vectorize/SLPVectorizer.cpp (original)
+++ llvm/trunk/lib/Transforms/Vectorize/SLPVectorizer.cpp Wed Mar 8 23:48:03 2017
@@ -1024,15 +1024,21 @@ template <> struct DOTGraphTraits<BoUpSL
DOTGraphTraits(bool isSimple = false) : DefaultDOTGraphTraits(isSimple) {}
- std::string getNodeLabel(const TreeEntry *Entry, const BoUpSLP *) {
+ std::string getNodeLabel(const TreeEntry *Entry, const BoUpSLP *R) {
std::string Str;
raw_string_ostream OS(Str);
if (isSplat(Entry->Scalars)) {
OS << "<splat> " << *Entry->Scalars[0];
return Str;
}
- for (auto V : Entry->Scalars)
- OS << *V << "\n";
+ for (auto V : Entry->Scalars) {
+ OS << *V;
+ if (std::any_of(
+ R->ExternalUses.begin(), R->ExternalUses.end(),
+ [&](const BoUpSLP::ExternalUser &EU) { return EU.Scalar == V; }))
+ OS << " <extract>";
+ OS << "\n";
+ }
return Str;
}
More information about the llvm-commits
mailing list