[mlir][NFC] Refactor eraseState
to take constant time
#19410
This job was skipped
Loading
eraseState
to take constant time
#19410