[ValueTracking] Let isGuaranteedNotToBeUndefOrPoison look into branch conditions...
authorJuneyoung Lee <aqjune@gmail.com>
Sat, 29 Feb 2020 06:45:04 +0000 (15:45 +0900)
committerJuneyoung Lee <aqjune@gmail.com>
Wed, 4 Mar 2020 02:43:31 +0000 (11:43 +0900)
commit952ad4701cf0d8da79789f6b83ddaa386c60d535
treebe74109ed2e1e52e23140dcfefd696e1cd10dc49
parente91e1df6ab74006e96b0cca94192e935542705a4
[ValueTracking] Let isGuaranteedNotToBeUndefOrPoison look into branch conditions of dominating blocks' terminators

Summary:
```
  br i1 c, BB1, BB2:
BB1:
  use1(c)
BB2:
  use2(c)
```

In BB1 and BB2, c is never undef or poison because otherwise the branch would have triggered UB.

Checked with Alive2

Reviewers: xbolva00, spatel, lebedev.ri, reames, jdoerfert, nlopes, sanjoy

Reviewed By: reames

Subscribers: jdoerfert, hiraditya, llvm-commits

Tags: #llvm

Differential Revision: https://reviews.llvm.org/D75401
llvm/include/llvm/Analysis/ValueTracking.h
llvm/lib/Analysis/InstructionSimplify.cpp
llvm/lib/Analysis/ValueTracking.cpp
llvm/test/Transforms/InstSimplify/freeze.ll