aboutsummaryrefslogtreecommitdiff
path: root/lib/Transforms
diff options
context:
space:
mode:
Diffstat (limited to 'lib/Transforms')
-rw-r--r--lib/Transforms/InstCombine/InstCombineCompares.cpp7
1 files changed, 4 insertions, 3 deletions
diff --git a/lib/Transforms/InstCombine/InstCombineCompares.cpp b/lib/Transforms/InstCombine/InstCombineCompares.cpp
index 26432d2eed..bb1cbfade3 100644
--- a/lib/Transforms/InstCombine/InstCombineCompares.cpp
+++ b/lib/Transforms/InstCombine/InstCombineCompares.cpp
@@ -2839,10 +2839,11 @@ Instruction *InstCombiner::visitFCmpInst(FCmpInst &I) {
// Avoid lossy conversions and denormals. Zero is a special case
// that's OK to convert.
- F.clearSign();
+ APFloat Fabs = F;
+ Fabs.clearSign();
if (!Lossy &&
- ((F.compare(APFloat::getSmallestNormalized(*Sem)) !=
- APFloat::cmpLessThan) || F.isZero()))
+ ((Fabs.compare(APFloat::getSmallestNormalized(*Sem)) !=
+ APFloat::cmpLessThan) || Fabs.isZero()))
return new FCmpInst(I.getPredicate(), LHSExt->getOperand(0),
ConstantFP::get(RHSC->getContext(), F));