-
Notifications
You must be signed in to change notification settings - Fork 26
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
AIRCopyToDma: Compose a chain of memref ops to src/dst memrefs, as canonicalizer #749
AIRCopyToDma: Compose a chain of memref ops to src/dst memrefs, as canonicalizer #749
Conversation
…air.channel.put/get and air.dma_memcpy_nd
for (unsigned i = 0; i < op->getNumResults(); i++) { | ||
op->getResult(i).replaceAllUsesWith(newOp->getResult(i)); | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Use the rewriter instead of direct IR modification:
for (unsigned i = 0; i < op->getNumResults(); i++) { | |
op->getResult(i).replaceAllUsesWith(newOp->getResult(i)); | |
} | |
rewriter.replaceOp(op, newOp); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great point. Updated to use replaceOpWithNewOp
method.
for (unsigned i = 0; i < op->getNumResults(); i++) { | ||
op->getResult(i).replaceAllUsesWith(newOp->getResult(i)); | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Use the rewriter instead of direct IR modification:
for (unsigned i = 0; i < op->getNumResults(); i++) { | |
op->getResult(i).replaceAllUsesWith(newOp->getResult(i)); | |
} | |
rewriter.replaceOp(op, newOp); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Updated.
for (unsigned i = 0; i < op->getNumResults(); i++) { | ||
op->getResult(i).replaceAllUsesWith(newOp->getResult(i)); | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Use the rewriter instead of direct IR modification:
for (unsigned i = 0; i < op->getNumResults(); i++) { | |
op->getResult(i).replaceAllUsesWith(newOp->getResult(i)); | |
} | |
rewriter.replaceOp(op, newOp); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Updated.
for (unsigned i = 0; i < op->getNumResults(); i++) { | ||
op->getResult(i).replaceAllUsesWith(newOp->getResult(i)); | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Use the rewriter instead of direct IR modification:
for (unsigned i = 0; i < op->getNumResults(); i++) { | |
op->getResult(i).replaceAllUsesWith(newOp->getResult(i)); | |
} | |
rewriter.replaceOp(op, newOp); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Updated.
for (auto dmaOp : dma_ops) { | ||
if (failed(condenseMemrefDataReorderingToAIRDma( | ||
std::get<0>(dmaOp), std::get<1>(dmaOp), std::get<2>(dmaOp)))) { | ||
return signalPassFailure(); | ||
} | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Run the moved code here?
for (auto dmaOp : dma_ops) { | |
if (failed(condenseMemrefDataReorderingToAIRDma( | |
std::get<0>(dmaOp), std::get<1>(dmaOp), std::get<2>(dmaOp)))) { | |
return signalPassFailure(); | |
} | |
} | |
RewritePatternSet pattern(ctx); | |
DmaMemcpyNdOp::getCanonicalizationPatterns(pattern, ctx); | |
(void)applyPatternsAndFoldGreedily(module, std::move(pattern)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great point. Updated.
No description provided.