[PATCH] D87399: Revert "[InstCombine] erase instructions leading up to unreachable"
Chandler Carruth via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Wed Sep 9 11:55:12 PDT 2020
chandlerc added a comment.
In D87399#2263996 <https://reviews.llvm.org/D87399#2263996>, @nikic wrote:
>> 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.
I'll follow up on this point in the original review thread for continuity.
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