[ValueTracking] Let isGuaranteedNotToBeUndefOrPoison look into branch conditions...
authorJuneyoung Lee <aqjune@gmail.com>
Thu, 5 Mar 2020 15:56:07 +0000 (00:56 +0900)
committerJuneyoung Lee <aqjune@gmail.com>
Thu, 5 Mar 2020 16:08:35 +0000 (01:08 +0900)
commitd7267ee1941668d7e985681e29d10983799811a0
tree4d751a9c3de5c4b0ee2245be9f2db8fc8ae480d4
parent85ae5aa6ff9247248dfafbaff29654dc416e8337
[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.

This is a resubmission of 952ad47 with crash fix of llvm/test/Transforms/LoopRotate/freeze-crash.ll.

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