[SLP] A couple of minor improvements for slp graph view - NFC.
authorValery N Dmitriev <valery.n.dmitriev@intel.com>
Thu, 29 Dec 2022 19:02:36 +0000 (11:02 -0800)
committerValery N Dmitriev <valery.n.dmitriev@intel.com>
Thu, 29 Dec 2022 19:02:36 +0000 (11:02 -0800)
Show ScatterVectorize nodes in frames of blue color
and print vectorize tree indices.

llvm/lib/Transforms/Vectorize/SLPVectorizer.cpp

index 65b9f57..7c695b6 100644 (file)
@@ -3507,6 +3507,7 @@ template <> struct DOTGraphTraits<BoUpSLP *> : public DefaultDOTGraphTraits {
   std::string getNodeLabel(const TreeEntry *Entry, const BoUpSLP *R) {
     std::string Str;
     raw_string_ostream OS(Str);
+    OS << Entry->Idx << ".\n";
     if (isSplat(Entry->Scalars))
       OS << "<splat> ";
     for (auto *V : Entry->Scalars) {
@@ -3524,6 +3525,8 @@ template <> struct DOTGraphTraits<BoUpSLP *> : public DefaultDOTGraphTraits {
                                        const BoUpSLP *) {
     if (Entry->State == TreeEntry::NeedToGather)
       return "color=red";
+    if (Entry->State == TreeEntry::ScatterVectorize)
+      return "color=blue";
     return "";
   }
 };