Added inst combine transforms for single bit tests from Chris's note
authorDinesh Dwivedi <dinesh.d@samsung.com>
Thu, 15 May 2014 06:01:33 +0000 (06:01 +0000)
committerDinesh Dwivedi <dinesh.d@samsung.com>
Thu, 15 May 2014 06:01:33 +0000 (06:01 +0000)
commitd10a54f07fac76add4be5f3756a6121d38484938
treea3dabb1172dd3ecc1d12c182b01824d91f6d8979
parentaf5e67a79b49c1d4f64d571e9d3a5648398438b6
Added inst combine transforms for single bit tests from Chris's note

if ((x & C) == 0) x |= C becomes x |= C
if ((x & C) != 0) x ^= C becomes x &= ~C
if ((x & C) == 0) x ^= C becomes x |= C
if ((x & C) != 0) x &= ~C becomes x &= ~C
if ((x & C) == 0) x &= ~C becomes nothing

Z3 Verifications code for above transform
http://rise4fun.com/Z3/Pmsh

Differential Revision: http://reviews.llvm.org/D3717

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