[PATCH] D87399: Revert "[InstCombine] erase instructions leading up to unreachable"

Nikita Popov via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Sep 9 11:17:45 PDT 2020


nikic requested changes to this revision.
nikic added a comment.
This revision now requires changes to proceed.

> 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.

As already explained in the referenced revision, this is not correct. Volatile accesses are not permitted to trap. LangRef is unambiguous on this point:

> The compiler may assume execution will continue after a volatile operation, so operations which modify memory or may have undefined behavior can be hoisted past a volatile operation.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D87399/new/

https://reviews.llvm.org/D87399



More information about the llvm-commits mailing list