[llvm] [profcheck] Fix profile metadata in IntegerDivision/ExpandIRinsts (PR #173114)
Aiden Grossman via llvm-commits
llvm-commits at lists.llvm.org
Wed Dec 31 20:51:24 PST 2025
================
@@ -252,7 +303,15 @@ static Value *generateUnsignedDivisionCode(Value *Dividend, Value *Divisor,
Value *Tmp2 = Builder.CreateSub(MSB, SR);
Value *Q = Builder.CreateShl(Dividend, Tmp2);
Value *SkipLoop = Builder.CreateICmpEQ(SR_1, Zero);
- Builder.CreateCondBr(SkipLoop, LoopExit, Preheader);
+ // This branch is highly unlikely. SR_1 (SR + 1) is expected to be in [1, 129]
----------------
boomanaiden154 wrote:
My comment was about the numbers in the comment being specific to a specific bit width when the function works for a variable bit width.
The comment should be reworded to be something like "We assume that the dividend is at least twice the value of the divisor in the common case" or something like that.
https://github.com/llvm/llvm-project/pull/173114
More information about the llvm-commits
mailing list