OSDN Git Service

InstCombine: simplify signed range checks
authorErik Eckstein <eeckstein@apple.com>
Wed, 3 Dec 2014 10:39:15 +0000 (10:39 +0000)
committerErik Eckstein <eeckstein@apple.com>
Wed, 3 Dec 2014 10:39:15 +0000 (10:39 +0000)
commit10e28ca6b15dcd528919b6c315a8a942d680adbd
treef0d119f2ff8361f1c0f41215ae2f68fc9e7d0ec2
parentcf988bca67249f3146a380df888514d1a2b2a7ee
InstCombine: simplify signed range checks

Try to convert two compares of a signed range check into a single unsigned compare.
Examples:
(icmp sge x, 0) & (icmp slt x, n) --> icmp ult x, n
(icmp slt x, 0) | (icmp sgt x, n) --> icmp ugt x, n

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@223224 91177308-0d34-0410-b5e6-96231b3b80d8
lib/Transforms/InstCombine/InstCombine.h
lib/Transforms/InstCombine/InstCombineAndOrXor.cpp
test/Transforms/InstCombine/range-check.ll [new file with mode: 0644]