Added inst combine tarnsform for (1 << X) & C pattrens where C is (some PowerOf2...
authorDinesh Dwivedi <dinesh.d@samsung.com>
Mon, 2 Jun 2014 07:57:24 +0000 (07:57 +0000)
committerDinesh Dwivedi <dinesh.d@samsung.com>
Mon, 2 Jun 2014 07:57:24 +0000 (07:57 +0000)
commitbcc4bce6b74e0dc161764095e1e854a25694ce7f
treeb8c3a7ffba975cca8458ada8d3eacc67cf1352ab
parentc469e543a02de7c87b6aa906d91e480ed249d8ac
Added inst combine tarnsform for (1 << X) & C pattrens where C is (some PowerOf2 - 1)

This patch can handles following cases from http://nondot.org/sabre/LLVMNotes/InstCombine.txt
  "((1 << X) & 7) == 0" ==> "X > 2"
  "((1 << X) & 7) != 0" ==> "X < 3".

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

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