Skip to content

Commit

Permalink
Fixes to correctly raise 2 level for loops to linalg.generic
Browse files Browse the repository at this point in the history
  • Loading branch information
arpitj1 committed Jul 31, 2024
1 parent ec041a0 commit 23138fc
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions lib/polygeist/Passes/RaiseToLinalg.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -472,7 +472,6 @@ struct AffineForOpRaising : public OpRewritePattern<affine::AffineForOp> {
while (cur != loop) {
auto ifstmt = dyn_cast<AffineIfOp>(cur);
if (!ifstmt) {
llvm::errs() << "internal cur which prevents hoising: " << *cur << "\n";
return WalkResult::interrupt();
}
bool ifTrue =
Expand All @@ -494,7 +493,6 @@ struct AffineForOpRaising : public OpRewritePattern<affine::AffineForOp> {
if (isReadNone(op)) {
return WalkResult::advance();
}
llvm::errs() << "internal op which prevents hoising: " << *op << "\n";
return WalkResult::interrupt();
});

Expand Down Expand Up @@ -539,7 +537,7 @@ struct AffineForOpRaising : public OpRewritePattern<affine::AffineForOp> {
// We're going to need to upgrade the defn of mayAlias for subviews (aka
// mayAlias(subview, x) -> mayAlias(operand(subview), x))

SmallVector<Value> inputs;
SmallVector<Value> inputs, outputs;
SmallVector<AffineMap> affineMaps;
SmallVector<AffineMap> indexingMaps;

Expand Down Expand Up @@ -705,7 +703,7 @@ struct AffineForOpRaising : public OpRewritePattern<affine::AffineForOp> {
auto newAffineMap = rewriter.getMultiDimIdentityMap(firstNDims+1);
// TODO: need to merge previous indexing maps and new affine maps
affineMaps.push_back(newAffineMap);
inputs.push_back(newMemref);
outputs.push_back(newMemref);
}
}

Expand Down Expand Up @@ -738,7 +736,7 @@ struct AffineForOpRaising : public OpRewritePattern<affine::AffineForOp> {
// TODO Push all of the inputs to the linalg generics (modifying maps as
// needed)

SmallVector<Value> outputs;
//SmallVector<Value> outputs;
// Store we may need to reindex into a splat potentially later, but for now
// we'll be lazy
for (auto &&[conds, store] : stores) {
Expand Down

0 comments on commit 23138fc

Please sign in to comment.