summaryrefslogtreecommitdiff
path: root/lib/Transforms/InstCombine/InstCombineAndOrXor.cpp
diff options
context:
space:
mode:
authorOwen Anderson <resistor@mac.com>2011-01-21 19:39:42 +0000
committerOwen Anderson <resistor@mac.com>2011-01-21 19:39:42 +0000
commit5d2e1889622cc20ada6146041e6d862a6588194f (patch)
tree7b0957dc3a0388152b28e13e728fe3d2d86e61ef /lib/Transforms/InstCombine/InstCombineAndOrXor.cpp
parent53519f015e3e84e9f57b677cc8724805a6009b73 (diff)
downloadllvm-5d2e1889622cc20ada6146041e6d862a6588194f.tar.gz
llvm-5d2e1889622cc20ada6146041e6d862a6588194f.tar.bz2
llvm-5d2e1889622cc20ada6146041e6d862a6588194f.tar.xz
Just because we have determined that an (fcmp | fcmp) is true for A < B,
A == B, and A > B, does not mean we can fold it to true. We still need to check for A ? B (A unordered B). git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@123993 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Transforms/InstCombine/InstCombineAndOrXor.cpp')
-rw-r--r--lib/Transforms/InstCombine/InstCombineAndOrXor.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/lib/Transforms/InstCombine/InstCombineAndOrXor.cpp b/lib/Transforms/InstCombine/InstCombineAndOrXor.cpp
index a27a566341..e6318e9bc8 100644
--- a/lib/Transforms/InstCombine/InstCombineAndOrXor.cpp
+++ b/lib/Transforms/InstCombine/InstCombineAndOrXor.cpp
@@ -172,7 +172,9 @@ static Value *getFCmpValue(bool isordered, unsigned code,
case 4: Pred = isordered ? FCmpInst::FCMP_OLT : FCmpInst::FCMP_ULT; break;
case 5: Pred = isordered ? FCmpInst::FCMP_ONE : FCmpInst::FCMP_UNE; break;
case 6: Pred = isordered ? FCmpInst::FCMP_OLE : FCmpInst::FCMP_ULE; break;
- case 7: return ConstantInt::getTrue(LHS->getContext());
+ case 7:
+ if (!isordered) return ConstantInt::getTrue(LHS->getContext());
+ Pred = FCmpInst::FCMP_ORD; break;
}
return Builder->CreateFCmp(Pred, LHS, RHS);
}