[JumpThread] We want to fold (not thread) when all predecessor go to single BB's...
authorXin Tong <trent.xin.tong@gmail.com>
Sun, 23 Apr 2017 20:56:29 +0000 (20:56 +0000)
committerXin Tong <trent.xin.tong@gmail.com>
Sun, 23 Apr 2017 20:56:29 +0000 (20:56 +0000)
commitf98602a1abe1c40921c8b67627b43cce36550b2f
tree257682987f7aa5f1200c3c344ccb7f0000253812
parent1d2169e2ee40011489c0660452188c288a9d2e39
[JumpThread] We want to fold (not thread) when all predecessor go to single BB's successor.

Summary:
In case all predecessor go to a single successor of current BB. We want to fold (not thread).

I failed to update the phi nodes properly in the last patch https://reviews.llvm.org/rL300657.

Phi nodes values are per predecessor in LLVM.

Reviewers: sanjoy

Reviewed By: sanjoy

Subscribers: llvm-commits

Differential Revision: https://reviews.llvm.org/D32400

llvm-svn: 301139
llvm/lib/Transforms/Scalar/JumpThreading.cpp
llvm/test/Transforms/JumpThreading/fold-not-thread.ll [new file with mode: 0644]