This reverts commit b22910daab95be1ebc6ab8a74190e38130b0e6ef.
See the discussion from https://reviews.llvm.org/D87149
- it is fine to remove instructions that can reach an unreachable instruction because running unreachable is undefined, and undefined behavior is retroactive.
- however, a volatile access can abort a program. In that case, an unreachable instruction after it is not reachable. So undefined behavior does not happen, and the volatile access cannot be removed.
It is possible to extend llvm::isGuaranteedToTransferExecutionToSuccessor to make this work.
Revert the change temporarily.