[PATCH] D87149: [InstCombine] erase instructions leading up to unreachable
Roman Lebedev via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Wed Sep 9 09:47:13 PDT 2020
lebedev.ri added a comment.
In D87149#2263725 <https://reviews.llvm.org/D87149#2263725>, @lebedev.ri wrote:
> In D87149#2263708 <https://reviews.llvm.org/D87149#2263708>, @nikic wrote:
>
>> @lebedev.ri I don't think the printf() case is any different. Keep in mind that undefined behavior acts retroactively, so if we know that unreachable will be executed later, we are free to optimize away side-effects before it as well. (If printf is not considered willreturn, then we cannot optimize it away, and won't.)
>
> IOW you are saying that in https://godbolt.org/z/TEo6oj `tail call void @_Z5errorv()` should ideally be optimized out?
Or, well, a better example: https://godbolt.org/z/r95b4G
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D87149/new/
https://reviews.llvm.org/D87149
More information about the llvm-commits
mailing list