Take indirect branch into account as well when folding.
authorXin Tong <trent.xin.tong@gmail.com>
Mon, 1 May 2017 17:15:37 +0000 (17:15 +0000)
committerXin Tong <trent.xin.tong@gmail.com>
Mon, 1 May 2017 17:15:37 +0000 (17:15 +0000)
commita4b9b9f42a514157169c39d0516aac2c4db77c4f
treeb9ddade3e0171650845bf81412bfd821abddb94c
parente369bd92da3d1cb1eb8ecd6c9530596f189f1e45
Take indirect branch into account as well when folding.

We may not be able to rewrite indirect branch target, but we also want to take it into
account when folding, i.e. if it and all its successor's predecessors go to the same
destination, we can fold, i.e. no need to thread.

llvm-svn: 301816
llvm/lib/Transforms/Scalar/JumpThreading.cpp
llvm/test/Transforms/JumpThreading/fold-not-thread.ll