[llvm-branch-commits] [llvm] [ProfCheck][Matrix] Add profile data where relevant (PR #181292)
Mircea Trofin via llvm-branch-commits
llvm-branch-commits at lists.llvm.org
Thu Feb 12 19:06:40 PST 2026
================
@@ -42,7 +44,10 @@ BasicBlock *TileInfo::CreateLoop(BasicBlock *Preheader, BasicBlock *Exit,
B.SetInsertPoint(Latch);
Value *Inc = B.CreateAdd(IV, Step, Name + ".step");
Value *Cond = B.CreateICmpNE(Inc, Bound, Name + ".cond");
- BranchInst::Create(Header, Exit, Cond, Latch);
+ auto *BR = BranchInst::Create(Header, Exit, Cond, Latch);
+ MDBuilder MDB(Preheader->getContext());
+ setFittedBranchWeights(*BR, {Bound->getZExtValue() / Step->getZExtValue(), 1},
----------------
mtrofin wrote:
> I don't think we need to worry as much here. The bounds end up getting set by the matrix size, which has to be specified as an immediate value to the intrinsics according to LangRef. We should never end up with a zero step as that value is decided by the pass.
assert then with the justification in the assertion message.
https://github.com/llvm/llvm-project/pull/181292
More information about the llvm-branch-commits
mailing list