[AMDGPU] prevent shrinking udiv/urem if either operand is in (SignedMax,UnsignedMax...
commitb8e1d4dbea8905e48d51a70bf75cb8fababa4a60
authorchoikwa <5455710+choikwa@users.noreply.github.com>
Wed, 20 Nov 2024 16:22:09 +0000 (20 11:22 -0500)
committerGitHub <noreply@github.com>
Wed, 20 Nov 2024 16:22:09 +0000 (20 11:22 -0500)
treef0d93ab996dfb4a9718c7f1877982a9b9cfbaffc
parent9d5b3c80175da59728d13c779051eaf5311c64f7
[AMDGPU] prevent shrinking udiv/urem if either operand is in (SignedMax,UnsignedMax] (#116733)

Do this by using ComputeKnownBits and checking for !isNonNegative and
isUnsigned. This rejects shrinking unsigned div/rem if operands exceed
smax_bitwidth since we know NumSignBits will be always 0.
llvm/lib/Target/AMDGPU/AMDGPUCodeGenPrepare.cpp
llvm/test/CodeGen/AMDGPU/amdgpu-codegenprepare-idiv.ll
llvm/test/CodeGen/AMDGPU/bypass-div.ll
llvm/test/CodeGen/AMDGPU/udiv64.ll
llvm/test/CodeGen/AMDGPU/urem64.ll