summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Transforms/InstCombine/InstCombineSelect.cpp
diff options
context:
space:
mode:
authorSanjay Patel <spatel@rotateright.com>2016-06-08 19:33:52 +0000
committerSanjay Patel <spatel@rotateright.com>2016-06-08 19:33:52 +0000
commit916f8a0cdb783d1dfe4dd458bc7cbc3c595037c9 (patch)
tree27e21f8eaf5cdd3b12c9162ec9662b31d9981a71 /llvm/lib/Transforms/InstCombine/InstCombineSelect.cpp
parentc321e534022768d424cf5c5ab43f99489e55bf07 (diff)
downloadbcm5719-llvm-916f8a0cdb783d1dfe4dd458bc7cbc3c595037c9.tar.gz
bcm5719-llvm-916f8a0cdb783d1dfe4dd458bc7cbc3c595037c9.zip
[InstCombine] use copyIRFlags() ; NFCI
llvm-svn: 272191
Diffstat (limited to 'llvm/lib/Transforms/InstCombine/InstCombineSelect.cpp')
-rw-r--r--llvm/lib/Transforms/InstCombine/InstCombineSelect.cpp14
1 files changed, 2 insertions, 12 deletions
diff --git a/llvm/lib/Transforms/InstCombine/InstCombineSelect.cpp b/llvm/lib/Transforms/InstCombine/InstCombineSelect.cpp
index 69773a57ecb..4d23ce9ac02 100644
--- a/llvm/lib/Transforms/InstCombine/InstCombineSelect.cpp
+++ b/llvm/lib/Transforms/InstCombine/InstCombineSelect.cpp
@@ -231,12 +231,7 @@ Instruction *InstCombiner::FoldSelectIntoOp(SelectInst &SI, Value *TrueVal,
BinaryOperator *TVI_BO = cast<BinaryOperator>(TVI);
BinaryOperator *BO = BinaryOperator::Create(TVI_BO->getOpcode(),
FalseVal, NewSel);
- if (isa<PossiblyExactOperator>(BO))
- BO->setIsExact(TVI_BO->isExact());
- if (isa<OverflowingBinaryOperator>(BO)) {
- BO->setHasNoUnsignedWrap(TVI_BO->hasNoUnsignedWrap());
- BO->setHasNoSignedWrap(TVI_BO->hasNoSignedWrap());
- }
+ BO->copyIRFlags(TVI_BO);
return BO;
}
}
@@ -266,12 +261,7 @@ Instruction *InstCombiner::FoldSelectIntoOp(SelectInst &SI, Value *TrueVal,
BinaryOperator *FVI_BO = cast<BinaryOperator>(FVI);
BinaryOperator *BO = BinaryOperator::Create(FVI_BO->getOpcode(),
TrueVal, NewSel);
- if (isa<PossiblyExactOperator>(BO))
- BO->setIsExact(FVI_BO->isExact());
- if (isa<OverflowingBinaryOperator>(BO)) {
- BO->setHasNoUnsignedWrap(FVI_BO->hasNoUnsignedWrap());
- BO->setHasNoSignedWrap(FVI_BO->hasNoSignedWrap());
- }
+ BO->copyIRFlags(FVI_BO);
return BO;
}
}
OpenPOWER on IntegriCloud