summaryrefslogtreecommitdiffstats
path: root/llvm/lib
diff options
context:
space:
mode:
authorBrian Gesiak <modocache@gmail.com>2017-03-19 04:40:42 +0000
committerBrian Gesiak <modocache@gmail.com>2017-03-19 04:40:42 +0000
commit1640e687280e653947811f4305f021be8f9472e5 (patch)
treee21109cae181ee557a35c5ece1c1b502d43bb915 /llvm/lib
parent662c9b1e81ae198cf6b609f4348d9e469ceba6a9 (diff)
downloadbcm5719-llvm-1640e687280e653947811f4305f021be8f9472e5.tar.gz
bcm5719-llvm-1640e687280e653947811f4305f021be8f9472e5.zip
[Analysis] bitreverse(undef) returns undef
Summary: The reverse of an artbitrary bitpattern is also an arbitrary bitpattern. Reviewers: trentxintong, arsenm, majnemer Reviewed By: majnemer Subscribers: majnemer, wdng, llvm-commits Differential Revision: https://reviews.llvm.org/D31118 llvm-svn: 298201
Diffstat (limited to 'llvm/lib')
-rw-r--r--llvm/lib/Analysis/ConstantFolding.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/llvm/lib/Analysis/ConstantFolding.cpp b/llvm/lib/Analysis/ConstantFolding.cpp
index 6d8d4a1c3e9..85ca622a25d 100644
--- a/llvm/lib/Analysis/ConstantFolding.cpp
+++ b/llvm/lib/Analysis/ConstantFolding.cpp
@@ -1768,7 +1768,8 @@ Constant *ConstantFoldScalarCall(StringRef Name, unsigned IntrinsicID, Type *Ty,
}
if (isa<UndefValue>(Operands[0])) {
- if (IntrinsicID == Intrinsic::bswap)
+ if (IntrinsicID == Intrinsic::bswap ||
+ IntrinsicID == Intrinsic::bitreverse)
return Operands[0];
return nullptr;
}
OpenPOWER on IntegriCloud