diff options
author | Chris Lattner <sabre@nondot.org> | 2007-10-24 18:54:45 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2007-10-24 18:54:45 +0000 |
commit | a6c7dce87a6bfd05f132432e6673e256a8ce8469 (patch) | |
tree | 130da89102d3fbaffcf96c5353e8b84ae676325e /lib/Transforms | |
parent | d20383fbe8426a0ea97db6bd19456176d6bddf67 (diff) | |
download | external_llvm-a6c7dce87a6bfd05f132432e6673e256a8ce8469.zip external_llvm-a6c7dce87a6bfd05f132432e6673e256a8ce8469.tar.gz external_llvm-a6c7dce87a6bfd05f132432e6673e256a8ce8469.tar.bz2 |
simplify some code by using the new isNaN predicate
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@43305 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Transforms')
-rw-r--r-- | lib/Transforms/Scalar/InstructionCombining.cpp | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/lib/Transforms/Scalar/InstructionCombining.cpp b/lib/Transforms/Scalar/InstructionCombining.cpp index ef86d28..56786b8 100644 --- a/lib/Transforms/Scalar/InstructionCombining.cpp +++ b/lib/Transforms/Scalar/InstructionCombining.cpp @@ -3637,8 +3637,7 @@ Instruction *InstCombiner::visitAnd(BinaryOperator &I) { if (ConstantFP *RHSC = dyn_cast<ConstantFP>(RHS->getOperand(1))) { // If either of the constants are nans, then the whole thing returns // false. - if (LHSC->getValueAPF().getCategory() == APFloat::fcNaN || - RHSC->getValueAPF().getCategory() == APFloat::fcNaN) + if (LHSC->getValueAPF().isNaN() || RHSC->getValueAPF().isNaN()) return ReplaceInstUsesWith(I, ConstantInt::getFalse()); return new FCmpInst(FCmpInst::FCMP_ORD, LHS->getOperand(0), RHS->getOperand(0)); @@ -4121,8 +4120,7 @@ Instruction *InstCombiner::visitOr(BinaryOperator &I) { if (ConstantFP *RHSC = dyn_cast<ConstantFP>(RHS->getOperand(1))) { // If either of the constants are nans, then the whole thing returns // true. - if (LHSC->getValueAPF().getCategory() == APFloat::fcNaN || - RHSC->getValueAPF().getCategory() == APFloat::fcNaN) + if (LHSC->getValueAPF().isNaN() || RHSC->getValueAPF().isNaN()) return ReplaceInstUsesWith(I, ConstantInt::getTrue()); // Otherwise, no need to compare the two constants, compare the |