@@ -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;
@@ -1406,8 +1405,7 @@ static Value *matchIsFiniteTest(InstCombiner::BuilderTy &Builder, FCmpInst *LHS,
14061405 return nullptr ;
14071406
14081407 return Builder.CreateFCmpFMF (FCmpInst::getOrderedPredicate (PredR), RHS0, RHS1,
1409- LHS->getFastMathFlags () &
1410- RHS->getFastMathFlags ());
1408+ FMFSource::intersect (LHS, RHS));
14111409}
14121410
14131411Value *InstCombinerImpl::foldLogicOfFCmps (FCmpInst *LHS, FCmpInst *RHS,
@@ -1444,7 +1442,7 @@ Value *InstCombinerImpl::foldLogicOfFCmps(FCmpInst *LHS, FCmpInst *RHS,
14441442 // Intersect the fast math flags.
14451443 // TODO: We can union the fast math flags unless this is a logical select.
14461444 return getFCmpValue (NewPred, LHS0, LHS1, Builder,
1447- LHS-> getFastMathFlags () & RHS-> getFastMathFlags ( ));
1445+ FMFSource::intersect (LHS, RHS));
14481446 }
14491447
14501448 // This transform is not valid for a logical select.
@@ -1461,8 +1459,8 @@ Value *InstCombinerImpl::foldLogicOfFCmps(FCmpInst *LHS, FCmpInst *RHS,
14611459 // Ignore the constants because they are obviously not NANs:
14621460 // (fcmp ord x, 0.0) & (fcmp ord y, 0.0) -> (fcmp ord x, y)
14631461 // (fcmp uno x, 0.0) | (fcmp uno y, 0.0) -> (fcmp uno x, y)
1464- return Builder.CreateFCmpFMF (
1465- PredL, LHS0, RHS0, LHS-> getFastMathFlags () & RHS-> getFastMathFlags ( ));
1462+ return Builder.CreateFCmpFMF (PredL, LHS0, RHS0,
1463+ FMFSource::intersect (LHS, RHS ));
14661464 }
14671465 }
14681466
0 commit comments