[PeepholeOpt] Erase optimized compare from LocalMIs earlier (#217848)
We need to drop the compare instruction that was optimized away from
LocalMIs before the LocalMIs-based load folding optimization a few lines
below. Addresses a regression from #194662.
Fixes https://github.com/llvm/llvm-project/issues/208746.
---------
Co-authored-by: woruyu <1214539920@qq.com>