This would create a double free when a memref is passed twice to the
same op. This wasn't a problem at the time the pass was written but is
common since the introduction of scf.while.
There's a latent non-determinism that's triggered by the test, but this
change is messy enough as-is so I'll leave that for later.
This assert checks that the interface is implemented correctly, i.e., that successor inputs + beginoperandindex actually point to the right thing. Can you reflect this in the message somehow?