@@ -18237,8 +18237,7 @@ SDValue DAGCombiner::visitFDIV(SDNode *N) {
18237
18237
// Only do the transform if the reciprocal is a legal fp immediate that
18238
18238
// isn't too nasty (eg NaN, denormal, ...).
18239
18239
if (((st == APFloat::opOK && !Recip.isDenormal()) ||
18240
- (st == APFloat::opInexact &&
18241
- (Options.UnsafeFPMath || Flags.hasAllowReciprocal()))) &&
18240
+ (st == APFloat::opInexact && Flags.hasAllowReciprocal())) &&
18242
18241
(!LegalOperations ||
18243
18242
// FIXME: custom lowering of ConstantFP might fail (see e.g. ARM
18244
18243
// backend)... we should handle this gracefully after Legalize.
@@ -18249,7 +18248,7 @@ SDValue DAGCombiner::visitFDIV(SDNode *N) {
18249
18248
DAG.getConstantFP(Recip, DL, VT));
18250
18249
}
18251
18250
18252
- if (Options.UnsafeFPMath || Flags.hasAllowReciprocal()) {
18251
+ if (Flags.hasAllowReciprocal()) {
18253
18252
// If this FDIV is part of a reciprocal square root, it may be folded
18254
18253
// into a target-specific square root estimate instruction.
18255
18254
if (N1.getOpcode() == ISD::FSQRT) {
@@ -18324,7 +18323,7 @@ SDValue DAGCombiner::visitFDIV(SDNode *N) {
18324
18323
18325
18324
// Fold X/Sqrt(X) -> Sqrt(X)
18326
18325
if ((Options.NoSignedZerosFPMath || Flags.hasNoSignedZeros()) &&
18327
- (Options.UnsafeFPMath || Flags.hasAllowReassociation() ))
18326
+ Flags.hasAllowReassociation())
18328
18327
if (N1.getOpcode() == ISD::FSQRT && N0 == N1.getOperand(0))
18329
18328
return N1;
18330
18329
0 commit comments