`RecursivelyDeleteTriviallyDeadInstructions` is introduced by https://github.com/llvm/llvm-project/pull/149047 to immediately drop dead instructions. However, it may invalidate the next iterator in `make_early_inc_range` in some edge cases, which leads to a crash. This patch manually maintains the next iterator and updates it when the next instruction is about to be deleted. Closes https://github.com/llvm/llvm-project/issues/155110.