Transform (x&C)>V into (x&C)!=0 where possible
authorPaul Redmond <paul.redmond@intel.com>
Wed, 19 Dec 2012 19:47:13 +0000 (19:47 +0000)
committerPaul Redmond <paul.redmond@intel.com>
Wed, 19 Dec 2012 19:47:13 +0000 (19:47 +0000)
commit5917f4c71597f9666c4e75decc1b5240f05130b5
tree0f201dd38bd74a6d4caa25baf98458bc51f565f9
parent8013df71c757afeaf996244bb050e09c0257189b
Transform (x&C)>V into (x&C)!=0 where possible

When the least bit of C is greater than V, (x&C) must be greater than V
if it is not zero, so the comparison can be simplified.

Although this was suggested in Target/X86/README.txt, it benefits any
architecture with a directly testable form of AND.

Patch by Kevin Schoedel

llvm-svn: 170576
llvm/lib/Target/X86/README.txt
llvm/lib/Transforms/InstCombine/InstCombineCompares.cpp
llvm/test/Transforms/InstCombine/icmp.ll