TensorCopyInsertion should not have been exposed as a pass. This was a flaw in the original design. It is a preparation step for bufferization and certain transforms (that would otherwise be legal) are illegal between TensorCopyInsertion and actual rewrite to MemRef ops. Therefore, even if broken down as two separate steps internally, they should be exposed as a single pass.
This change affects the sparse compiler, which uses TensorCopyInsertionPass. A new SparseBufferizationPass is added to replace all passes in the sparse tensor pipeline from TensorCopyInsertionPass until the actual bufferization (rewrite to memref/non-tensor). It is generally unsafe to run arbitrary passes in-between, in particular passes that hoist tensor ops out of loops or change SSA use-def chains along tensor ops.
I wonder if this is still relevant here? Before this differential this conditional bailed out before doing all our various sparse passes, but now it's only doing so after all of SparseBufferizationPass. So I'm thinking the conditional should either be moved into SparseBufferizationPass or else removed entirely