|
15 | 15 | #ifndef MLIR_SUPPORT_CYCLICREPLACERCACHE_H
|
16 | 16 | #define MLIR_SUPPORT_CYCLICREPLACERCACHE_H
|
17 | 17 |
|
18 |
| -#include "mlir/IR/Visitors.h" |
| 18 | +#include "llvm/ADT/DenseMap.h" |
19 | 19 | #include "llvm/ADT/DenseSet.h"
|
20 |
| -#include "llvm/ADT/MapVector.h" |
| 20 | +#include <optional> |
21 | 21 | #include <set>
|
22 | 22 |
|
23 | 23 | namespace mlir {
|
@@ -116,30 +116,30 @@ class CyclicReplacerCache {
|
116 | 116 | void finalizeReplacement(InT element, OutT result);
|
117 | 117 |
|
118 | 118 | CycleBreakerFn cycleBreaker;
|
119 |
| - DenseMap<InT, OutT> standaloneCache; |
| 119 | + llvm::DenseMap<InT, OutT> standaloneCache; |
120 | 120 |
|
121 | 121 | struct DependentReplacement {
|
122 | 122 | OutT replacement;
|
123 | 123 | /// The highest replacement frame index that this cache entry is dependent
|
124 | 124 | /// on.
|
125 | 125 | size_t highestDependentFrame;
|
126 | 126 | };
|
127 |
| - DenseMap<InT, DependentReplacement> dependentCache; |
| 127 | + llvm::DenseMap<InT, DependentReplacement> dependentCache; |
128 | 128 |
|
129 | 129 | struct ReplacementFrame {
|
130 | 130 | /// The set of elements that is only legal while under this current frame.
|
131 | 131 | /// They need to be removed from the cache when this frame is popped off the
|
132 | 132 | /// replacement stack.
|
133 |
| - DenseSet<InT> dependingReplacements; |
| 133 | + llvm::DenseSet<InT> dependingReplacements; |
134 | 134 | /// The set of frame indices that this current frame's replacement is
|
135 | 135 | /// dependent on, ordered from highest to lowest.
|
136 | 136 | std::set<size_t, std::greater<size_t>> dependentFrames;
|
137 | 137 | };
|
138 | 138 | /// Every element currently in the progress of being replaced pushes a frame
|
139 | 139 | /// onto this stack.
|
140 |
| - SmallVector<ReplacementFrame> replacementStack; |
| 140 | + llvm::SmallVector<ReplacementFrame> replacementStack; |
141 | 141 | /// Maps from each input element to its indices on the replacement stack.
|
142 |
| - DenseMap<InT, SmallVector<size_t, 2>> cyclicElementFrame; |
| 142 | + llvm::DenseMap<InT, llvm::SmallVector<size_t, 2>> cyclicElementFrame; |
143 | 143 | /// If set to true, we are currently asking an element to break a cycle. No
|
144 | 144 | /// more recursive invocations is allowed while this is true (the replacement
|
145 | 145 | /// stack can no longer grow).
|
|
0 commit comments