Details
Details
Diff Detail
Diff Detail
- Repository
- rG LLVM Github Monorepo
Event Timeline
Comment Actions
Thanks @pifon2a!
mlir/lib/Dialect/Linalg/IR/LinalgOps.cpp | ||
---|---|---|
2124–2135 | Not directly related to this change but I believe we are not supposed to create op from another builder than rewriter in rewrite patterns. It will cause problem if the rewriter later decide this transformation should not happen. I'm not sure there is an easy way to reproduce it. Could we use rewriter.inlineRegionBefore instead? I think something like that would work instead: rewriter.eraseBlock(newTiledLoop.getBody()); rewriter.inlineRegionBefore(tiledLoop.region(), newTiledLoop.region(), newTiledLoop.region().end()); Operation* terminator = newTiledLoop.getBody()->getTerminator(); rewriter.setInsertionPoint(terminator); rewriter.create<linalg::YieldOp>(loc, newYieldArgs); rewriter.eraseOp(terminator); |
Comment Actions
@ThomasRaoux Yes, this is dangerous, if the "inner" builder was created without rewriter.getListener() passed to it.
Not directly related to this change but I believe we are not supposed to create op from another builder than rewriter in rewrite patterns. It will cause problem if the rewriter later decide this transformation should not happen. I'm not sure there is an easy way to reproduce it.
Could we use rewriter.inlineRegionBefore instead? I think something like that would work instead: