Skip to content

Commit e8f385a

Browse files
committed
[InstCombine] Use FMFSource::intersect. NFC.
1 parent 097d1c9 commit e8f385a

File tree

2 files changed

+2
-4
lines changed

2 files changed

+2
-4
lines changed

llvm/lib/Transforms/InstCombine/InstCombineAndOrXor.cpp

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1674,9 +1674,7 @@ static Instruction *reassociateFCmps(BinaryOperator &BO,
16741674
// or (fcmp uno X, 0), (or (fcmp uno Y, 0), Z) --> or (fcmp uno X, Y), Z
16751675
// Intersect FMF from the 2 source fcmps.
16761676
Value *NewFCmp =
1677-
Builder.CreateFCmpFMF(NanPred, X, Y,
1678-
cast<FPMathOperator>(Op0)->getFastMathFlags() &
1679-
cast<FPMathOperator>(BO10)->getFastMathFlags());
1677+
Builder.CreateFCmpFMF(NanPred, X, Y, FMFSource::intersect(Op0, BO10));
16801678
return BinaryOperator::Create(Opcode, NewFCmp, BO11);
16811679
}
16821680

llvm/lib/Transforms/InstCombine/InstCombineCalls.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2505,7 +2505,7 @@ Instruction *InstCombinerImpl::visitCallInst(CallInst &CI) {
25052505
// propagate?)
25062506
Value *V = Builder.CreateBinaryIntrinsic(
25072507
IID, X, ConstantFP::get(Arg0->getType(), Res),
2508-
II->getFastMathFlags() & M->getFastMathFlags());
2508+
FMFSource::intersect(II, M));
25092509
return replaceInstUsesWith(*II, V);
25102510
}
25112511
}

0 commit comments

Comments
 (0)