[llvm] ec24e23 - [SandboxVectorizer][NFC] Make SeedContainer dump follow preferred approach (#112634)

via llvm-commits llvm-commits at lists.llvm.org
Wed Oct 16 17:06:26 PDT 2024


Author: Sterling-Augustine
Date: 2024-10-16T17:06:23-07:00
New Revision: ec24e23d8452e29c36518b64851a012e1d71f546

URL: https://github.com/llvm/llvm-project/commit/ec24e23d8452e29c36518b64851a012e1d71f546
DIFF: https://github.com/llvm/llvm-project/commit/ec24e23d8452e29c36518b64851a012e1d71f546.diff

LOG: [SandboxVectorizer][NFC] Make SeedContainer dump follow preferred approach (#112634)

Added: 
    

Modified: 
    llvm/include/llvm/Transforms/Vectorize/SandboxVectorizer/SeedCollector.h
    llvm/lib/Transforms/Vectorize/SandboxVectorizer/SeedCollector.cpp

Removed: 
    


################################################################################
diff  --git a/llvm/include/llvm/Transforms/Vectorize/SandboxVectorizer/SeedCollector.h b/llvm/include/llvm/Transforms/Vectorize/SandboxVectorizer/SeedCollector.h
index 6bad38b637d2a8..a4512862136a8b 100644
--- a/llvm/include/llvm/Transforms/Vectorize/SandboxVectorizer/SeedCollector.h
+++ b/llvm/include/llvm/Transforms/Vectorize/SandboxVectorizer/SeedCollector.h
@@ -279,6 +279,7 @@ class SeedContainer {
   unsigned size() const { return Bundles.size(); }
 
 #ifndef NDEBUG
+  void print(raw_ostream &OS) const;
   LLVM_DUMP_METHOD void dump() const;
 #endif // NDEBUG
 };

diff  --git a/llvm/lib/Transforms/Vectorize/SandboxVectorizer/SeedCollector.cpp b/llvm/lib/Transforms/Vectorize/SandboxVectorizer/SeedCollector.cpp
index 20df9e344b61cd..66fac080a7b7cc 100644
--- a/llvm/lib/Transforms/Vectorize/SandboxVectorizer/SeedCollector.cpp
+++ b/llvm/lib/Transforms/Vectorize/SandboxVectorizer/SeedCollector.cpp
@@ -112,21 +112,23 @@ template void SeedContainer::insert<LoadInst>(LoadInst *);
 template void SeedContainer::insert<StoreInst>(StoreInst *);
 
 #ifndef NDEBUG
-void SeedContainer::dump() const {
+void SeedContainer::print(raw_ostream &OS) const {
   for (const auto &Pair : Bundles) {
     auto [I, Ty, Opc] = Pair.first;
     const auto &SeedsVec = Pair.second;
     std::string RefType = dyn_cast<LoadInst>(I)    ? "Load"
                           : dyn_cast<StoreInst>(I) ? "Store"
                                                    : "Other";
-    dbgs() << "[Inst=" << *I << " Ty=" << Ty << " " << RefType << "]\n";
+    OS << "[Inst=" << *I << " Ty=" << Ty << " " << RefType << "]\n";
     for (const auto &SeedPtr : SeedsVec) {
-      SeedPtr->dump(dbgs());
-      dbgs() << "\n";
+      SeedPtr->dump(OS);
+      OS << "\n";
     }
   }
-  dbgs() << "\n";
+  OS << "\n";
 }
+
+LLVM_DUMP_METHOD void SeedContainer::dump() const { print(dbgs()); }
 #endif // NDEBUG
 
 } // namespace llvm::sandboxir


        


More information about the llvm-commits mailing list