OSDN Git Service

There is a trunc(lshr (zext A), Cst) optimization in InstCombineCasts that
authorJakub Kuderski <jakub.kuderski@arm.com>
Thu, 10 Sep 2015 11:31:20 +0000 (11:31 +0000)
committerJakub Kuderski <jakub.kuderski@arm.com>
Thu, 10 Sep 2015 11:31:20 +0000 (11:31 +0000)
commitd42deae8d8e0fceff75fa5f827f1b82c7af41288
tree90c3d969ba04b4b535620258e8ec7f0bbd6b09c8
parent32e95cb90f61daf73034fe613df81f379266724e
There is a trunc(lshr (zext A), Cst) optimization in InstCombineCasts that
removes cast by performing the lshr on smaller types. However, currently there
is no trunc(lshr (sext A), Cst) variant.
This patch add such optimization by transforming trunc(lshr (sext A), Cst)
to ashr A, Cst.

Differential Revision: http://reviews.llvm.org/D12520

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