summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Transforms
diff options
context:
space:
mode:
authorJim Grosbach <grosbach@apple.com>2011-09-30 19:58:46 +0000
committerJim Grosbach <grosbach@apple.com>2011-09-30 19:58:46 +0000
commit011dafba614c84e4855bacda6b494dcf14223ea3 (patch)
treea63b3db63a315e3c5055d3ea0f72711f1a782642 /llvm/lib/Transforms
parent2f0cbf6a997dcb4d57d5bf8752433970d6f32abf (diff)
downloadbcm5719-llvm-011dafba614c84e4855bacda6b494dcf14223ea3.tar.gz
bcm5719-llvm-011dafba614c84e4855bacda6b494dcf14223ea3.zip
Don't modify constant in-place.
llvm-svn: 140875
Diffstat (limited to 'llvm/lib/Transforms')
-rw-r--r--llvm/lib/Transforms/InstCombine/InstCombineCompares.cpp7
1 files changed, 4 insertions, 3 deletions
diff --git a/llvm/lib/Transforms/InstCombine/InstCombineCompares.cpp b/llvm/lib/Transforms/InstCombine/InstCombineCompares.cpp
index 26432d2eed5..bb1cbfade34 100644
--- a/llvm/lib/Transforms/InstCombine/InstCombineCompares.cpp
+++ b/llvm/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));
OpenPOWER on IntegriCloud