]> granicus.if.org Git - llvm/commit
[JumpThreading] Add a pattern to TryToUnfoldSelectInCurrBB()
authorHaicheng Wu <haicheng@codeaurora.org>
Fri, 14 Jul 2017 19:16:47 +0000 (19:16 +0000)
committerHaicheng Wu <haicheng@codeaurora.org>
Fri, 14 Jul 2017 19:16:47 +0000 (19:16 +0000)
commit18e1269d26c44c7c08bf7f7ea909675d7d5a0b40
tree371244f7b57cc7a7c86bd7dd51f7afa3184e9de2
parent2670e69e43738659e2a6833182998a1da5da6157
[JumpThreading] Add a pattern to TryToUnfoldSelectInCurrBB()

Add the following pattern to TryToUnfoldSelectInCurrBB()

bb:
   %p = phi [0, %bb1], [1, %bb2], [0, %bb3], [1, %bb4], ...
   %c = cmp %p, 0
   %s = select %c, trueval, falseval

The Select in the above pattern will be unfolded and then jump-threaded. The
current implementation does not allow CMP in the middle of PHI and Select.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@308050 91177308-0d34-0410-b5e6-96231b3b80d8
lib/Transforms/Scalar/JumpThreading.cpp
test/Transforms/JumpThreading/select.ll