Hello,
I am creating a Pass which “trials” several possibilities on how to modify the IR, then applies the best solution. So I need to clone the IR for each trial, modify the clones, then replace the IR with the most beneficial clone. i.e. something like:
void MyPass::runOnOperation() {
mlir::Operation *cloneOp = getOperation()->clone();
// Make changes to cloneOp
// How do I replace the main operation with my clone, such that getOperation() is identical to cloneOp?
}
But as you can see, I cannot see how to replace the IR once I have selected the clone that I want to use. Please can you help?
Thank you!