Skip to content

Commit 213ec15

Browse files
authored
Remove redundant analyzers (#42)
1 parent 147969c commit 213ec15

File tree

1 file changed

+5
-10
lines changed

1 file changed

+5
-10
lines changed

src/tir/transforms/lower_sparse_tir.cc

Lines changed: 5 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -117,8 +117,7 @@ PrimExpr AggregateOffset(PrimExpr prev_offset, Axis axis, PrimExpr index, arith:
117117
class SparseBlockCtx {
118118
private:
119119
struct Scope {
120-
explicit Scope(SparseBlock sp_block, arith::Analyzer* ana)
121-
: sp_block(std::move(sp_block)), ana(ana) {
120+
explicit Scope(SparseBlock sp_block) : sp_block(std::move(sp_block)) {
122121
for (const SpIterVar& sp_iter_var : this->sp_block->sp_iter_vars) {
123122
axis2sp_iter.Set(sp_iter_var->axis, sp_iter_var);
124123
sp_iter_var_map.Set(sp_iter_var->var, sp_iter_var);
@@ -133,15 +132,13 @@ class SparseBlockCtx {
133132
Map<Var, SpIterVar> sp_iter_var_map;
134133
/*! \brief The stored offsets of the sparse iterators in the sparse block */
135134
Map<SpIterVar, PrimExpr> cached_offsets;
136-
/*! \brief The analyzer */
137-
arith::Analyzer* ana;
138135
};
139136

140137
public:
141138
explicit SparseBlockCtx(arith::Analyzer* ana) : ana_(ana) {}
142139

143140
void EnterScope(const SparseBlockNode* sp_block) {
144-
stack_.emplace_back(GetRef<SparseBlock>(sp_block), ana_);
141+
stack_.emplace_back(GetRef<SparseBlock>(sp_block));
145142
}
146143

147144
void ExitScope() { stack_.pop_back(); }
@@ -233,8 +230,8 @@ class SparseBlockCtx {
233230
class SparseBufferAccessCtx {
234231
private:
235232
struct Scope {
236-
explicit Scope(SparseBuffer sp_buffer, const SparseBlockCtx* sp_blk_ctx, arith::Analyzer* ana)
237-
: sp_buffer(std::move(sp_buffer)), sp_blk_ctx(sp_blk_ctx), ana(ana) {
233+
explicit Scope(SparseBuffer sp_buffer, const SparseBlockCtx* sp_blk_ctx)
234+
: sp_buffer(std::move(sp_buffer)), sp_blk_ctx(sp_blk_ctx) {
238235
offsets.reserve(this->sp_buffer->ndim() + 1);
239236
offsets.push_back(Integer(0));
240237
n_matched_iters = 0;
@@ -249,15 +246,13 @@ class SparseBufferAccessCtx {
249246
int n_matched_iters;
250247
/*! \brief The sparse block context of the sparse block that this access is in */
251248
const SparseBlockCtx* sp_blk_ctx;
252-
/*! \brief The analyzer */
253-
arith::Analyzer* ana;
254249
};
255250

256251
public:
257252
explicit SparseBufferAccessCtx(arith::Analyzer* ana) : ana_(ana) {}
258253

259254
void EnterScope(SparseBuffer sp_buffer, const SparseBlockCtx* sp_blk_ctx) {
260-
stack_.emplace_back(sp_buffer, sp_blk_ctx, ana_);
255+
stack_.emplace_back(sp_buffer, sp_blk_ctx);
261256
}
262257

263258
void ExitScope() { stack_.pop_back(); }

0 commit comments

Comments
 (0)