@@ -39,8 +39,7 @@ static Value *getNewICmpValue(unsigned Code, bool Sign, Value *LHS, Value *RHS,
3939// / This is the complement of getFCmpCode, which turns an opcode and two
4040// / operands into either a FCmp instruction, or a true/false constant.
4141static Value *getFCmpValue (unsigned Code, Value *LHS, Value *RHS,
42- InstCombiner::BuilderTy &Builder,
43- FastMathFlags FMF) {
42+ InstCombiner::BuilderTy &Builder, FMFSource FMF) {
4443 FCmpInst::Predicate NewPred;
4544 if (Constant *TorF = getPredForFCmpCode (Code, LHS->getType (), NewPred))
4645 return TorF;
@@ -1431,8 +1430,7 @@ static Value *matchIsFiniteTest(InstCombiner::BuilderTy &Builder, FCmpInst *LHS,
14311430 return nullptr ;
14321431
14331432 return Builder.CreateFCmpFMF (FCmpInst::getOrderedPredicate (PredR), RHS0, RHS1,
1434- LHS->getFastMathFlags () &
1435- RHS->getFastMathFlags ());
1433+ FMFSource::intersect (LHS, RHS));
14361434}
14371435
14381436Value *InstCombinerImpl::foldLogicOfFCmps (FCmpInst *LHS, FCmpInst *RHS,
@@ -1469,7 +1467,7 @@ Value *InstCombinerImpl::foldLogicOfFCmps(FCmpInst *LHS, FCmpInst *RHS,
14691467 // Intersect the fast math flags.
14701468 // TODO: We can union the fast math flags unless this is a logical select.
14711469 return getFCmpValue (NewPred, LHS0, LHS1, Builder,
1472- LHS-> getFastMathFlags () & RHS-> getFastMathFlags ( ));
1470+ FMFSource::intersect (LHS, RHS));
14731471 }
14741472
14751473 // This transform is not valid for a logical select.
@@ -1486,8 +1484,8 @@ Value *InstCombinerImpl::foldLogicOfFCmps(FCmpInst *LHS, FCmpInst *RHS,
14861484 // Ignore the constants because they are obviously not NANs:
14871485 // (fcmp ord x, 0.0) & (fcmp ord y, 0.0) -> (fcmp ord x, y)
14881486 // (fcmp uno x, 0.0) | (fcmp uno y, 0.0) -> (fcmp uno x, y)
1489- return Builder.CreateFCmpFMF (
1490- PredL, LHS0, RHS0, LHS-> getFastMathFlags () & RHS-> getFastMathFlags ( ));
1487+ return Builder.CreateFCmpFMF (PredL, LHS0, RHS0,
1488+ FMFSource::intersect (LHS, RHS ));
14911489 }
14921490 }
14931491
0 commit comments