Teach InstCombine to work with smaller legal types in icmp (shl %v, C1), C2
authorArnaud A. de Grandmaison <arnaud.adegm@gmail.com>
Fri, 15 Feb 2013 14:35:47 +0000 (14:35 +0000)
committerArnaud A. de Grandmaison <arnaud.adegm@gmail.com>
Fri, 15 Feb 2013 14:35:47 +0000 (14:35 +0000)
commit61c167c62b6852351102cdbcc80a5207d7fef1bb
tree5b59b3c0b2786c9dd1516ed7832d59a752cba3cb
parent2e44769ed21b9190ff288e3c4e0a90a59a60f576
Teach InstCombine to work with smaller legal types in icmp (shl %v, C1), C2

It enables to work with a smaller constant, which is target friendly for those which can compare to immediates.
It also avoids inserting a shift in favor of a trunc, which can be free on some targets.

This used to work until LLVM-3.1, but regressed with the 3.2 release.

llvm-svn: 175270
llvm/lib/Transforms/InstCombine/InstCombineCompares.cpp
llvm/test/Transforms/InstCombine/exact.ll
llvm/test/Transforms/InstCombine/icmp.ll