OSDN Git Service

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)
commit7c5c9b39c91d5f53284011c0ddbf458d553740da
tree4d42d27ea27de9c55a544ac4dd5c94ab826784c2
parent85d2760c8e1d36657ae4d86a6aeee03b3a723d9c
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.

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