[InstCombine] Teach how to fold a select into a cttz/ctlz with the 'is_zero_undef...
authorAndrea Di Biagio <Andrea_DiBiagio@sn.scee.net>
Tue, 27 Jan 2015 15:58:14 +0000 (15:58 +0000)
committerAndrea Di Biagio <Andrea_DiBiagio@sn.scee.net>
Tue, 27 Jan 2015 15:58:14 +0000 (15:58 +0000)
commit944d86558eae35e40e9f8a6bbfd626bea939abf5
treea825927b135c81c6b25d6d6a1a016bf0c3098123
parent0b2455c374129e38ef1e31b615571d74f81d943d
[InstCombine] Teach how to fold a select into a cttz/ctlz with the 'is_zero_undef' flag.

This patch teaches the Instruction Combiner how to fold a cttz/ctlz followed by
a icmp plus select into a single cttz/ctlz with flag 'is_zero_undef' cleared.

Added test InstCombine/select-cmp-cttz-ctlz.ll.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@227197 91177308-0d34-0410-b5e6-96231b3b80d8
lib/Transforms/InstCombine/InstCombineSelect.cpp
test/Transforms/InstCombine/intrinsics.ll
test/Transforms/InstCombine/select-cmp-cttz-ctlz.ll [new file with mode: 0644]