Skip to content

Commit db98be3

Browse files
committed
[InstCombine] Minor cleanup for optimizeFMod. NFC
1 parent 97a784e commit db98be3

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

llvm/lib/Transforms/Utils/SimplifyLibCalls.cpp

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2797,22 +2797,21 @@ Value *LibCallSimplifier::optimizeSqrt(CallInst *CI, IRBuilderBase &B) {
27972797
}
27982798

27992799
Value *LibCallSimplifier::optimizeFMod(CallInst *CI, IRBuilderBase &B) {
2800-
SimplifyQuery SQ(DL, TLI, DT, AC, CI, true, true, DC);
28012800

28022801
// fmod(x,y) can set errno if y == 0 or x == +/-inf, and returns Nan in those
28032802
// case. If we know those do not happen, then we can convert the fmod into
28042803
// frem.
28052804
bool IsNoNan = CI->hasNoNaNs();
28062805
if (!IsNoNan) {
2806+
SimplifyQuery SQ(DL, TLI, DT, AC, CI, true, true, DC);
28072807
KnownFPClass Known0 = computeKnownFPClass(CI->getOperand(0), fcInf,
28082808
/*Depth=*/0, SQ);
28092809
if (Known0.isKnownNeverInfinity()) {
28102810
KnownFPClass Known1 =
28112811
computeKnownFPClass(CI->getOperand(1), fcZero | fcSubnormal,
28122812
/*Depth=*/0, SQ);
28132813
Function *F = CI->getParent()->getParent();
2814-
if (Known1.isKnownNeverLogicalZero(*F, CI->getType()))
2815-
IsNoNan = true;
2814+
IsNoNan = Known1.isKnownNeverLogicalZero(*F, CI->getType());
28162815
}
28172816
}
28182817

0 commit comments

Comments
 (0)