summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Analysis/DemandedBits.cpp
diff options
context:
space:
mode:
authorBrian Gesiak <modocache@gmail.com>2017-04-13 16:44:25 +0000
committerBrian Gesiak <modocache@gmail.com>2017-04-13 16:44:25 +0000
commit0a7894d99c0842a4cd870b40c400f31db6798eab (patch)
tree72551193c61dfdb05391ae1024ba28021cdd3cbb /llvm/lib/Analysis/DemandedBits.cpp
parentd6fea19a97fffa702f697b4d084888be03357e08 (diff)
downloadbcm5719-llvm-0a7894d99c0842a4cd870b40c400f31db6798eab.tar.gz
bcm5719-llvm-0a7894d99c0842a4cd870b40c400f31db6798eab.zip
[Analysis] Support bitreverse in -demanded-bits pass
Summary: * Add a bitreverse case in the demanded bits analysis pass. * Add tests for the bitreverse (and bswap) intrinsic in the demanded bits pass. * Add a test case to the BDCE tests: that manipulations to high-order bits are eliminated once the bits are reversed and then right-shifted. Reviewers: mkuper, jmolloy, hfinkel, trentxintong Reviewed By: jmolloy Subscribers: llvm-commits Differential Revision: https://reviews.llvm.org/D31857 llvm-svn: 300215
Diffstat (limited to 'llvm/lib/Analysis/DemandedBits.cpp')
-rw-r--r--llvm/lib/Analysis/DemandedBits.cpp3
1 files changed, 3 insertions, 0 deletions
diff --git a/llvm/lib/Analysis/DemandedBits.cpp b/llvm/lib/Analysis/DemandedBits.cpp
index 688c1db534c..151c0b0e6c9 100644
--- a/llvm/lib/Analysis/DemandedBits.cpp
+++ b/llvm/lib/Analysis/DemandedBits.cpp
@@ -110,6 +110,9 @@ void DemandedBits::determineLiveOperandBits(
// the output.
AB = AOut.byteSwap();
break;
+ case Intrinsic::bitreverse:
+ AB = AOut.reverseBits();
+ break;
case Intrinsic::ctlz:
if (OperandNo == 0) {
// We need some output bits, so we need all bits of the
OpenPOWER on IntegriCloud