]> granicus.if.org Git - llvm/commit
Added inst combine transforms for single bit tests from Chris's note
authorDinesh Dwivedi <dinesh.d@samsung.com>
Mon, 2 Jun 2014 07:24:36 +0000 (07:24 +0000)
committerDinesh Dwivedi <dinesh.d@samsung.com>
Mon, 2 Jun 2014 07:24:36 +0000 (07:24 +0000)
commitc469e543a02de7c87b6aa906d91e480ed249d8ac
tree14d1bbbc14da5b4f08c7ed74f6b7fe8ee1feeb83
parent01fa655228c1e8460e1aaf23bc80cb669b1cefaa
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

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

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