Hello.
I have a MLIR function:
func @SingleSWLayer(%arg0: memref<1000xf16>, %arg1: memref<1000xf16>) → memref<1000xf16> {
%0 = Dialect.AnOperation inputs(%arg0 : memref<1000xf16>) outputs(%arg1 : memref<1000xf16>) → memref<1000xf16>
return %0 : memref<1000xf16>
}
I want to erase Operation %0. But for doing this I need to get rid of the use %0 in return %0.
What operation would you advise me to create to replace with %0? I need to have a code something like this:
// create the new Operation:
newOperation = bld.create<...>(getLoc(), ...);
// oldOperation is %0
oldOperation.replaceAllUsesWith(newOperation);
oldOperation.erase();
(We do this to avoid the error: 'Dialect.AnOperation' op operation destroyed but still has uses).
Please let me know what actual mlir::Operation should be newOperation? Should it be a NoOperation, if such exists?
Thank you very much,
Alex