summaryrefslogtreecommitdiffstats
path: root/llvm/lib
diff options
context:
space:
mode:
authorCraig Topper <craig.topper@gmail.com>2017-06-04 08:21:53 +0000
committerCraig Topper <craig.topper@gmail.com>2017-06-04 08:21:53 +0000
commitd470d73c2d4c5c1894b1dfc48bbd0792240b5259 (patch)
tree1dad27cc37952ba108d043d055d61ddbff2c2de7 /llvm/lib
parent0dd29e2256bea676faa3db5ec143e29b3a7c8d54 (diff)
downloadbcm5719-llvm-d470d73c2d4c5c1894b1dfc48bbd0792240b5259.tar.gz
bcm5719-llvm-d470d73c2d4c5c1894b1dfc48bbd0792240b5259.zip
[ConstantFolding] Combine an if statement into an earlier one that checked the same condition. NFC
llvm-svn: 304681
Diffstat (limited to 'llvm/lib')
-rw-r--r--llvm/lib/Analysis/ConstantFolding.cpp10
1 files changed, 3 insertions, 7 deletions
diff --git a/llvm/lib/Analysis/ConstantFolding.cpp b/llvm/lib/Analysis/ConstantFolding.cpp
index 4267ed24e9f..8170c38afb7 100644
--- a/llvm/lib/Analysis/ConstantFolding.cpp
+++ b/llvm/lib/Analysis/ConstantFolding.cpp
@@ -1584,6 +1584,9 @@ Constant *ConstantFoldScalarCall(StringRef Name, unsigned IntrinsicID, Type *Ty,
// cosine(arg) is between -1 and 1. cosine(invalid arg) is NaN
if (IntrinsicID == Intrinsic::cos)
return Constant::getNullValue(Ty);
+ if (IntrinsicID == Intrinsic::bswap ||
+ IntrinsicID == Intrinsic::bitreverse)
+ return Operands[0];
}
if (auto *Op = dyn_cast<ConstantFP>(Operands[0])) {
if (IntrinsicID == Intrinsic::convert_to_fp16) {
@@ -1828,13 +1831,6 @@ Constant *ConstantFoldScalarCall(StringRef Name, unsigned IntrinsicID, Type *Ty,
}
}
- if (isa<UndefValue>(Operands[0])) {
- if (IntrinsicID == Intrinsic::bswap ||
- IntrinsicID == Intrinsic::bitreverse)
- return Operands[0];
- return nullptr;
- }
-
return nullptr;
}
OpenPOWER on IntegriCloud