InstCombine: simplify comparisons to zero of (shl %x, Cst) or (mul %x, Cst)
authorArnaud A. de Grandmaison <arnaud.adegm@gmail.com>
Mon, 25 Mar 2013 09:48:49 +0000 (09:48 +0000)
committerArnaud A. de Grandmaison <arnaud.adegm@gmail.com>
Mon, 25 Mar 2013 09:48:49 +0000 (09:48 +0000)
commit35763b1ee700cd29f057494a35095f06d983fe6e
tree542a5882930e075017f43d72e71cd6c95a7726c8
parentf0a15d88afce23453ff55894400035014ad46a15
InstCombine: simplify comparisons to zero of (shl %x, Cst) or (mul %x, Cst)

This simplification happens at 2 places :
 - using the nsw attribute when the shl / mul is used by a sign test
 - when the shl / mul is compared for (in)equality to zero

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