OSDN Git Service

[DemandedBits] Add support for funnel shifts
authorNikita Popov <nikita.ppv@gmail.com>
Mon, 26 Nov 2018 15:36:57 +0000 (15:36 +0000)
committerNikita Popov <nikita.ppv@gmail.com>
Mon, 26 Nov 2018 15:36:57 +0000 (15:36 +0000)
commit753cb246ac322cee7547f0c951da24903a493d60
tree8f42af400bf89ede78f4963bbe5b6df2bad4951f
parent12ece5753e011afdd8626de75366d26001eb1ca1
[DemandedBits] Add support for funnel shifts

Add support for funnel shifts to the DemandedBits analysis. The
demanded bits of the first two operands can be determined if the
shift amount is constant. The demanded bits of the third operand
(shift amount) can be determined if the bitwidth is a power of two.

This is basically the same functionality as implemented in D54869
and D54478, but for DemandedBits rather than InstCombine.

Differential Revision: https://reviews.llvm.org/D54876

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@347561 91177308-0d34-0410-b5e6-96231b3b80d8
lib/Analysis/DemandedBits.cpp
test/Analysis/DemandedBits/intrinsics.ll