OSDN Git Service

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)
commit6da2e22dffe9dd0255e10a8934f2879eb7e87868
tree7390c767149a6d4c64394a7894dcc83910d68be4
parent433cb080bac56b4fac56f7625e07e17b4824ce8a
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

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