Skip to content

Commit 069fbeb

Browse files
committed
Revert "[SandboxVec][Interval][NFC] Move a few definitions from header to .cpp"
This reverts commit 24c6035.
1 parent 24c6035 commit 069fbeb

File tree

2 files changed

+24
-27
lines changed
  • llvm
    • include/llvm/Transforms/Vectorize/SandboxVectorizer
    • lib/Transforms/Vectorize/SandboxVectorizer

2 files changed

+24
-27
lines changed

llvm/include/llvm/Transforms/Vectorize/SandboxVectorizer/Interval.h

Lines changed: 24 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -136,7 +136,13 @@ template <typename T> class Interval {
136136
return bottom()->comesBefore(Other.top());
137137
}
138138
/// \Returns true if this and \p Other have nothing in common.
139-
bool disjoint(const Interval &Other) const;
139+
bool disjoint(const Interval &Other) const {
140+
if (Other.empty())
141+
return true;
142+
if (empty())
143+
return true;
144+
return Other.Bottom->comesBefore(Top) || Bottom->comesBefore(Other.Top);
145+
}
140146
/// \Returns the intersection between this and \p Other.
141147
// Example:
142148
// |----| this
@@ -226,7 +232,23 @@ template <typename T> class Interval {
226232
}
227233

228234
#ifndef NDEBUG
229-
void print(raw_ostream &OS) const;
235+
void print(raw_ostream &OS) const {
236+
auto *Top = top();
237+
auto *Bot = bottom();
238+
OS << "Top: ";
239+
if (Top != nullptr)
240+
OS << *Top;
241+
else
242+
OS << "nullptr";
243+
OS << "\n";
244+
245+
OS << "Bot: ";
246+
if (Bot != nullptr)
247+
OS << *Bot;
248+
else
249+
OS << "nullptr";
250+
OS << "\n";
251+
}
230252
LLVM_DUMP_METHOD void dump() const;
231253
#endif
232254
};

llvm/lib/Transforms/Vectorize/SandboxVectorizer/Interval.cpp

Lines changed: 0 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -16,32 +16,7 @@ namespace llvm::sandboxir {
1616
template class Interval<Instruction>;
1717
template class Interval<MemDGNode>;
1818

19-
template <typename T> bool Interval<T>::disjoint(const Interval &Other) const {
20-
if (Other.empty())
21-
return true;
22-
if (empty())
23-
return true;
24-
return Other.Bottom->comesBefore(Top) || Bottom->comesBefore(Other.Top);
25-
}
26-
2719
#ifndef NDEBUG
28-
template <typename T> void Interval<T>::print(raw_ostream &OS) const {
29-
auto *Top = top();
30-
auto *Bot = bottom();
31-
OS << "Top: ";
32-
if (Top != nullptr)
33-
OS << *Top;
34-
else
35-
OS << "nullptr";
36-
OS << "\n";
37-
38-
OS << "Bot: ";
39-
if (Bot != nullptr)
40-
OS << *Bot;
41-
else
42-
OS << "nullptr";
43-
OS << "\n";
44-
}
4520
template <typename T> void Interval<T>::dump() const { print(dbgs()); }
4621
#endif
4722
} // namespace llvm::sandboxir

0 commit comments

Comments
 (0)