[ValueTracking] A value is never undef or poison if it must raise UB
authorJuneyoung Lee <aqjune@gmail.com>
Sat, 29 Feb 2020 04:10:31 +0000 (13:10 +0900)
committerJuneyoung Lee <aqjune@gmail.com>
Sat, 29 Feb 2020 22:35:58 +0000 (07:35 +0900)
commit282ec40504369e6533e03d7690417feb0da8cdd4
treed43a5013d847968f1b8e5fb668004964cc5326f4
parent5cbb26569474f33a39942255ba96f3427c155087
[ValueTracking] A value is never undef or poison if it must raise UB

Summary:
This patch helps isGuaranteedNotToBeUndefOrPoison return true if the value
makes the program always undefined.

According to value tracking functions' comments, it is not still in consensus
whether a poison value can be bitwise or not, so conservatively only the case with
i1 is considered.

Reviewers: spatel, lebedev.ri, reames, nlopes, regehr

Reviewed By: nlopes

Subscribers: uenoku, hiraditya, llvm-commits

Tags: #llvm

Differential Revision: https://reviews.llvm.org/D75396
llvm/lib/Analysis/ValueTracking.cpp