Example:
%0 = linalg.init_tensor : tensor<...> %1 = linalg.generic ... outs(%0: tensor<...>) %2 = linalg.generic ... outs(%0: tensor<...>)
Memref allocated as a result of init_tensor bufferization can be incorrectly overwritten by the second linalg.generic operation
you might be able to just delete this code block. I think the code below can handle it.