[llvm] [AMDGPU] Be more careful about using expandDivRem24 (PR #201186)

Matt Arsenault via llvm-commits llvm-commits at lists.llvm.org
Wed Jun 3 03:18:06 PDT 2026


================
@@ -1018,46 +1019,49 @@ static Value* getMulHu(IRBuilder<> &Builder, Value *LHS, Value *RHS) {
 /// Figure out how many bits are really needed for this division.
 /// \p MaxDivBits is an optimization hint to bypass the second
 /// ComputeNumSignBits/computeKnownBits call if the first one is
-/// insufficient.
-unsigned AMDGPUCodeGenPrepareImpl::getDivNumBits(BinaryOperator &I, Value *Num,
-                                                 Value *Den,
-                                                 unsigned MaxDivBits,
-                                                 bool IsSigned) const {
+/// already known to require more than MaxDivBits.  Return false if DivBits is
+/// known to be too big. Also, calculate LHSBits, the number of bits needed to
+/// represent Num.
+
----------------
arsenm wrote:

```suggestion
```

https://github.com/llvm/llvm-project/pull/201186


More information about the llvm-commits mailing list