mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-08-08 19:25:47 +00:00
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
This commit is contained in:
@@ -3637,8 +3637,7 @@ Instruction *InstCombiner::visitAnd(BinaryOperator &I) {
|
|||||||
if (ConstantFP *RHSC = dyn_cast<ConstantFP>(RHS->getOperand(1))) {
|
if (ConstantFP *RHSC = dyn_cast<ConstantFP>(RHS->getOperand(1))) {
|
||||||
// If either of the constants are nans, then the whole thing returns
|
// If either of the constants are nans, then the whole thing returns
|
||||||
// false.
|
// false.
|
||||||
if (LHSC->getValueAPF().getCategory() == APFloat::fcNaN ||
|
if (LHSC->getValueAPF().isNaN() || RHSC->getValueAPF().isNaN())
|
||||||
RHSC->getValueAPF().getCategory() == APFloat::fcNaN)
|
|
||||||
return ReplaceInstUsesWith(I, ConstantInt::getFalse());
|
return ReplaceInstUsesWith(I, ConstantInt::getFalse());
|
||||||
return new FCmpInst(FCmpInst::FCMP_ORD, LHS->getOperand(0),
|
return new FCmpInst(FCmpInst::FCMP_ORD, LHS->getOperand(0),
|
||||||
RHS->getOperand(0));
|
RHS->getOperand(0));
|
||||||
@@ -4121,8 +4120,7 @@ Instruction *InstCombiner::visitOr(BinaryOperator &I) {
|
|||||||
if (ConstantFP *RHSC = dyn_cast<ConstantFP>(RHS->getOperand(1))) {
|
if (ConstantFP *RHSC = dyn_cast<ConstantFP>(RHS->getOperand(1))) {
|
||||||
// If either of the constants are nans, then the whole thing returns
|
// If either of the constants are nans, then the whole thing returns
|
||||||
// true.
|
// true.
|
||||||
if (LHSC->getValueAPF().getCategory() == APFloat::fcNaN ||
|
if (LHSC->getValueAPF().isNaN() || RHSC->getValueAPF().isNaN())
|
||||||
RHSC->getValueAPF().getCategory() == APFloat::fcNaN)
|
|
||||||
return ReplaceInstUsesWith(I, ConstantInt::getTrue());
|
return ReplaceInstUsesWith(I, ConstantInt::getTrue());
|
||||||
|
|
||||||
// Otherwise, no need to compare the two constants, compare the
|
// Otherwise, no need to compare the two constants, compare the
|
||||||
|
Reference in New Issue
Block a user