[ValueTracking] Let propagatesPoison support binops/unaryops/cast/etc.
authorJuneyoung Lee <aqjune@gmail.com>
Mon, 20 Apr 2020 15:35:45 +0000 (00:35 +0900)
committerJuneyoung Lee <aqjune@gmail.com>
Tue, 12 May 2020 17:51:42 +0000 (02:51 +0900)
commite5f602d82ca05d113c725fdfff405dcb7c5470f5
tree1e1ac3181e117da6a56671b773bd357698559cef
parent01636c1eeace5371fef8508c7318df9d7a25b489
[ValueTracking] Let propagatesPoison support binops/unaryops/cast/etc.

Summary:
This patch makes propagatesPoison be more accurate by returning true on
more bin ops/unary ops/casts/etc.

The changed test in ScalarEvolution/nsw.ll was introduced by
https://github.com/llvm/llvm-project/commit/a19edc4d15b0dae0210b90615775edd76f021008 .
IIUC, the goal of the tests is to show that iv.inc's SCEV expression still has
no-overflow flags even if the loop isn't in the wanted form.
It becomes more accurate with this patch, so think this is okay.

Reviewers: spatel, lebedev.ri, jdoerfert, reames, nikic, sanjoy

Reviewed By: spatel, nikic

Subscribers: regehr, nlopes, efriedma, fhahn, javed.absar, llvm-commits, hiraditya

Tags: #llvm

Differential Revision: https://reviews.llvm.org/D78615
llvm/include/llvm/Analysis/ValueTracking.h
llvm/lib/Analysis/ValueTracking.cpp
llvm/lib/Transforms/Instrumentation/PoisonChecking.cpp
llvm/test/Analysis/ScalarEvolution/nsw.ll
llvm/unittests/Analysis/ValueTrackingTest.cpp