summaryrefslogtreecommitdiffstats
path: root/gnu/llvm/lib/Transforms/Scalar/Reassociate.cpp
diff options
context:
space:
mode:
authorpatrick <patrick@openbsd.org>2017-03-14 08:07:52 +0000
committerpatrick <patrick@openbsd.org>2017-03-14 08:07:52 +0000
commit1cb66ada17adf0954eaadba4d02ec2470365a3ac (patch)
tree521159d8f39562a43fffd680147eb5a71709b9b1 /gnu/llvm/lib/Transforms/Scalar/Reassociate.cpp
parentMark the sshd_config UsePrivilegeSeparation option as deprecated, (diff)
downloadwireguard-openbsd-1cb66ada17adf0954eaadba4d02ec2470365a3ac.tar.xz
wireguard-openbsd-1cb66ada17adf0954eaadba4d02ec2470365a3ac.zip
Import LLVM 4.0.0 release including clang and lld.
Diffstat (limited to 'gnu/llvm/lib/Transforms/Scalar/Reassociate.cpp')
-rw-r--r--gnu/llvm/lib/Transforms/Scalar/Reassociate.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/gnu/llvm/lib/Transforms/Scalar/Reassociate.cpp b/gnu/llvm/lib/Transforms/Scalar/Reassociate.cpp
index 181a324861e..65c814d7a63 100644
--- a/gnu/llvm/lib/Transforms/Scalar/Reassociate.cpp
+++ b/gnu/llvm/lib/Transforms/Scalar/Reassociate.cpp
@@ -1521,8 +1521,8 @@ Value *ReassociatePass::OptimizeAdd(Instruction *I,
if (ConstantInt *CI = dyn_cast<ConstantInt>(Factor)) {
if (CI->isNegative() && !CI->isMinValue(true)) {
Factor = ConstantInt::get(CI->getContext(), -CI->getValue());
- assert(!Duplicates.count(Factor) &&
- "Shouldn't have two constant factors, missed a canonicalize");
+ if (!Duplicates.insert(Factor).second)
+ continue;
unsigned Occ = ++FactorOccurrences[Factor];
if (Occ > MaxOcc) {
MaxOcc = Occ;
@@ -1534,8 +1534,8 @@ Value *ReassociatePass::OptimizeAdd(Instruction *I,
APFloat F(CF->getValueAPF());
F.changeSign();
Factor = ConstantFP::get(CF->getContext(), F);
- assert(!Duplicates.count(Factor) &&
- "Shouldn't have two constant factors, missed a canonicalize");
+ if (!Duplicates.insert(Factor).second)
+ continue;
unsigned Occ = ++FactorOccurrences[Factor];
if (Occ > MaxOcc) {
MaxOcc = Occ;