Skip to content

Commit 8634c59

Browse files
author
Peiming Liu
committed
cleanup LoopEmitter
1 parent e453449 commit 8634c59

File tree

4 files changed

+43
-1832
lines changed

4 files changed

+43
-1832
lines changed

mlir/lib/Dialect/SparseTensor/Transforms/SparseTensorRewriting.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1126,7 +1126,7 @@ struct ForeachRewriter : public OpRewritePattern<ForeachOp> {
11261126
}
11271127

11281128
Value vals = loopEmitter.getValBuffer()[0];
1129-
Value pos = loopEmitter.getPosits()[0].back();
1129+
Value pos = loopEmitter.getValPosits(0);
11301130
// Loads the value from sparse tensor using position-index;
11311131
// loads the value from dense tensor using coords.
11321132
Value val = enc ? rewriter.create<memref::LoadOp>(loc, vals, pos)

mlir/lib/Dialect/SparseTensor/Transforms/Sparsification.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -354,7 +354,7 @@ static Value genSubscript(CodegenEnv &env, OpBuilder &builder, OpOperand *t,
354354
const auto stt = getSparseTensorType(t->get());
355355
if (stt.hasEncoding()) {
356356
// For sparse tensors we only push the last-level's position onto `args`.
357-
const auto pos = env.emitter().getPosits()[tid].back();
357+
const auto pos = env.emitter().getValPosits(tid);
358358
assert(pos);
359359
args.push_back(pos);
360360
} else {
@@ -893,7 +893,7 @@ static scf::IfOp genIf(CodegenEnv &env, OpBuilder &builder, LoopId curr,
893893
if (isCompressedLT(lt) || isSingletonLT(lt) ||
894894
isLooseCompressedLT(lt) || is2OutOf4LT(lt)) {
895895
assert(lvl.has_value());
896-
const Value crd = env.emitter().getCoords()[tid][*lvl];
896+
const Value crd = env.emitter().getCoord(tid, *lvl);
897897
const Value lvar = env.getLoopVar(curr);
898898
clause = builder.create<arith::CmpIOp>(loc, arith::CmpIPredicate::eq,
899899
crd, lvar);

0 commit comments

Comments
 (0)