Skip to content

Commit 40ab484

Browse files
arsenmzjaffal
andcommitted
Reorder checks
Co-authored-by: Zain Jaffal <[email protected]>
1 parent 303ce4c commit 40ab484

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

llvm/lib/Transforms/InstCombine/InstCombineMulDivRem.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1724,7 +1724,7 @@ static Instruction *foldFDivSqrtDivisor(BinaryOperator &I,
17241724

17251725
Value *Y, *Z;
17261726
auto *DivOp = dyn_cast<Instruction>(II->getOperand(0));
1727-
if (!DivOp || !DivOp->hasOneUse() || !DivOp->hasAllowReassoc() ||
1727+
if (!DivOp || !DivOp->hasAllowReassoc() || !I.hasAllowReciprocal() || !DivOp->hasOneUse())
17281728
!I.hasAllowReciprocal())
17291729
return nullptr;
17301730
if (match(DivOp, m_FDiv(m_Value(Y), m_Value(Z)))) {

0 commit comments

Comments
 (0)