[llvm] 24c6035 - [SandboxVec][Interval][NFC] Move a few definitions from header to .cpp
Vasileios Porpodas via llvm-commits
llvm-commits at lists.llvm.org
Wed Jan 15 15:24:25 PST 2025
Author: Vasileios Porpodas
Date: 2025-01-15T15:23:28-08:00
New Revision: 24c603505f91b2979d13e0b963fbd3c0174a005f
URL: https://github.com/llvm/llvm-project/commit/24c603505f91b2979d13e0b963fbd3c0174a005f
DIFF: https://github.com/llvm/llvm-project/commit/24c603505f91b2979d13e0b963fbd3c0174a005f.diff
LOG: [SandboxVec][Interval][NFC] Move a few definitions from header to .cpp
Added:
Modified:
llvm/include/llvm/Transforms/Vectorize/SandboxVectorizer/Interval.h
llvm/lib/Transforms/Vectorize/SandboxVectorizer/Interval.cpp
Removed:
################################################################################
diff --git a/llvm/include/llvm/Transforms/Vectorize/SandboxVectorizer/Interval.h b/llvm/include/llvm/Transforms/Vectorize/SandboxVectorizer/Interval.h
index 922dd2c3a1f893..18cd29e9e14ee4 100644
--- a/llvm/include/llvm/Transforms/Vectorize/SandboxVectorizer/Interval.h
+++ b/llvm/include/llvm/Transforms/Vectorize/SandboxVectorizer/Interval.h
@@ -136,13 +136,7 @@ template <typename T> class Interval {
return bottom()->comesBefore(Other.top());
}
/// \Returns true if this and \p Other have nothing in common.
- bool disjoint(const Interval &Other) const {
- if (Other.empty())
- return true;
- if (empty())
- return true;
- return Other.Bottom->comesBefore(Top) || Bottom->comesBefore(Other.Top);
- }
+ bool disjoint(const Interval &Other) const;
/// \Returns the intersection between this and \p Other.
// Example:
// |----| this
@@ -232,23 +226,7 @@ template <typename T> class Interval {
}
#ifndef NDEBUG
- void print(raw_ostream &OS) const {
- auto *Top = top();
- auto *Bot = bottom();
- OS << "Top: ";
- if (Top != nullptr)
- OS << *Top;
- else
- OS << "nullptr";
- OS << "\n";
-
- OS << "Bot: ";
- if (Bot != nullptr)
- OS << *Bot;
- else
- OS << "nullptr";
- OS << "\n";
- }
+ void print(raw_ostream &OS) const;
LLVM_DUMP_METHOD void dump() const;
#endif
};
diff --git a/llvm/lib/Transforms/Vectorize/SandboxVectorizer/Interval.cpp b/llvm/lib/Transforms/Vectorize/SandboxVectorizer/Interval.cpp
index 79b37444195359..7822b304ce9bdb 100644
--- a/llvm/lib/Transforms/Vectorize/SandboxVectorizer/Interval.cpp
+++ b/llvm/lib/Transforms/Vectorize/SandboxVectorizer/Interval.cpp
@@ -16,7 +16,32 @@ namespace llvm::sandboxir {
template class Interval<Instruction>;
template class Interval<MemDGNode>;
+template <typename T> bool Interval<T>::disjoint(const Interval &Other) const {
+ if (Other.empty())
+ return true;
+ if (empty())
+ return true;
+ return Other.Bottom->comesBefore(Top) || Bottom->comesBefore(Other.Top);
+}
+
#ifndef NDEBUG
+template <typename T> void Interval<T>::print(raw_ostream &OS) const {
+ auto *Top = top();
+ auto *Bot = bottom();
+ OS << "Top: ";
+ if (Top != nullptr)
+ OS << *Top;
+ else
+ OS << "nullptr";
+ OS << "\n";
+
+ OS << "Bot: ";
+ if (Bot != nullptr)
+ OS << *Bot;
+ else
+ OS << "nullptr";
+ OS << "\n";
+}
template <typename T> void Interval<T>::dump() const { print(dbgs()); }
#endif
} // namespace llvm::sandboxir
More information about the llvm-commits
mailing list