[JIT] ARM64 - Overflow check optimizations for division (#82924)
* Do not emit overflow check for div if we know first operand is a constant that is a not a min value * Remove redundant branch * Update codegenarm64.cpp * Try to use subs, zr, dividendReg, 1 to determine overflow in division * Cleanup * Use IsNeverNegative to help not emit overflow checks * Fix check * Added helper functions * Use main node instead of op1 for type check * Add 64-bit check * Use cmp instead of subs since it is an alias * Handle 32-bit arch division for LONG. * Additional checks * More cleanup * More cleanup * Do not find exception blocks * Try using flags * Try using flags * More checks, more comments * Update src/coreclr/jit/gentree.cpp Co-authored-by: NSingleAccretion <62474226+SingleAccretion@users.noreply.github.com> * Flip meaning of check flags. Rename OperExceptions to GetExceptionSetFlags. Use GetExceptionSetFlags to determine to add div-by-zero or overflow blocks for arm64. * Use GetExceptionSetFlags in arm64 codegen * Revert name * Use GTF_DIV_MOD_NO_OVERFLOW_CHK in CanDivOrModPossiblyOverflow * Fix build * Rename flags by removing '_CHK' * Remove break --------- Co-authored-by: NSingleAccretion <62474226+SingleAccretion@users.noreply.github.com>
Showing
想要评论请 注册 或 登录