[llvm] [AMDGPU] Rework getDivNumBits API (PR #119768)
via llvm-commits
llvm-commits at lists.llvm.org
Fri Dec 13 09:46:11 PST 2024
choikwa wrote:
>From debugging, I've observed that in shrinkDivRem64,
```
int NumDivBits = getDivNumBits(I, Num, Den, 32 /*AtLeast*/, IsSigned);
if (NumDivBits == -1)
return nullptr;
```
It's rejecting the case where operands of Num or Den have <=32 DivNumBits but the SignNumBits are also <32. Such a case arises when i.e. Num or Den is ` %1 = ashr i48 %x, 24` or when source's number of scalar bits are in (64,32) since AtLeast logic only depends on number of sign bits.
https://github.com/llvm/llvm-project/pull/119768
More information about the llvm-commits
mailing list