Skip to content

Commit ffe61f9

Browse files
authored
Fix null error in constrankreduce (#254)
1 parent 68ddfc8 commit ffe61f9

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

lib/polygeist/Ops.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2598,7 +2598,7 @@ struct ConstantRankReduction : public OpRewritePattern<memref::AllocaOp> {
25982598
}
25992599
if (auto load = dyn_cast<AffineLoadOp>(u)) {
26002600
rewriter.replaceOpWithNewOp<AffineLoadOp>(
2601-
load, newOp, AffineMap::get(load.getContext()), ArrayRef<Value>());
2601+
load, newOp, AffineMap::get(op.getContext()), ArrayRef<Value>());
26022602
continue;
26032603
}
26042604
if (auto store = dyn_cast<memref::StoreOp>(u)) {
@@ -2643,7 +2643,7 @@ struct ConstantRankReduction : public OpRewritePattern<memref::AllocaOp> {
26432643
store, TypeRange(), cond, /*hasElse*/ false);
26442644
rewriter.setInsertionPointToStart(ifOp.thenBlock());
26452645
rewriter.create<AffineStoreOp>(loc, val, newOp,
2646-
AffineMap::get(store.getContext()),
2646+
AffineMap::get(op.getContext()),
26472647
ArrayRef<Value>());
26482648
continue;
26492649
}

0 commit comments

Comments
 (0)