[llvm] [SandboxVectorizer][NFC] Make SeedContainer dump follow preferred approach (PR #112634)
via llvm-commits
llvm-commits at lists.llvm.org
Wed Oct 16 16:44:24 PDT 2024
llvmbot wrote:
<!--LLVM PR SUMMARY COMMENT-->
@llvm/pr-subscribers-vectorizers
Author: None (Sterling-Augustine)
<details>
<summary>Changes</summary>
---
Full diff: https://github.com/llvm/llvm-project/pull/112634.diff
2 Files Affected:
- (modified) llvm/include/llvm/Transforms/Vectorize/SandboxVectorizer/SeedCollector.h (+1)
- (modified) llvm/lib/Transforms/Vectorize/SandboxVectorizer/SeedCollector.cpp (+7-5)
``````````diff
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
``````````
</details>
https://github.com/llvm/llvm-project/pull/112634
More information about the llvm-commits
mailing list