[SimplifyCFG] Improve the precision of `PtrValueMayBeModified`
authorDianQK <dianqk@dianqk.net>
Sat, 25 Feb 2023 11:42:58 +0000 (19:42 +0800)
committerDianQK <dianqk@dianqk.net>
Sat, 25 Feb 2023 11:42:59 +0000 (19:42 +0800)
commitf890f010f6a70addbd885acd0c8d1b9578b6246f
tree2e58c0930d8349d34318e42432fab3c479903cc1
parent191240d9b6f19d841846123b0c665c6b1177efd4
[SimplifyCFG] Improve the precision of `PtrValueMayBeModified`

The result value of `getelementptr inbounds (TY, null, not zero)` is a poison value. We can think of it as undefined behavior.

> Please let me know if there is anything I don't understand correctly.

Reviewed By: nikic, xbolva00

Differential Revision: https://reviews.llvm.org/D144563
llvm/lib/Transforms/Utils/SimplifyCFG.cpp
llvm/test/Transforms/SimplifyCFG/UnreachableEliminate.ll
llvm/test/Transforms/SimplifyCFG/unreachable-eliminate-on-ret.ll