Skip to content

Commit 24820b6

Browse files
authored
Remove redundant check for DivideByZeroException for unsigned division/modulo. (#99228)
The check was already generated at the beginning of the branch for integer operations.
1 parent f84d33c commit 24820b6

File tree

1 file changed

+0
-13
lines changed

1 file changed

+0
-13
lines changed

src/coreclr/jit/codegenriscv64.cpp

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -2482,19 +2482,6 @@ void CodeGen::genCodeForDivMod(GenTreeOp* tree)
24822482
}
24832483
else // if (tree->OperIs(GT_UDIV, GT_UMOD))
24842484
{
2485-
// Only one possible exception
2486-
// (AnyVal / 0) => DivideByZeroException
2487-
//
2488-
// Note that division by the constant 0 was already checked for above by the
2489-
// op2->IsIntegralConst(0) check
2490-
2491-
if ((exceptions & ExceptionSetFlags::DivideByZeroException) != ExceptionSetFlags::None &&
2492-
!divisorOp->IsCnsIntOrI())
2493-
{
2494-
// divisorOp is not a constant, so it could be zero
2495-
genJumpToThrowHlpBlk_la(SCK_DIV_BY_ZERO, INS_beq, divisorReg);
2496-
}
2497-
24982485
if (tree->OperIs(GT_UDIV))
24992486
{
25002487
ins = is4 ? INS_divuw : INS_divu;

0 commit comments

Comments
 (0)