[llvm] [LV][NFC] Print more debug to account for mismatch in final costs (PR #227757)

David Sherwood via llvm-commits llvm-commits at lists.llvm.org
Wed Sep 30 08:54:14 PDT 2026


================
@@ -20,6 +20,7 @@ target triple = "aarch64--linux-gnu"
 ;
 ; CHECK: Scalarizing and predicating: %tmp4 = udiv i32 %tmp2, %tmp3
 ; CHECK: Cost of 7 for VF 2: REPLICATE ir<%tmp4> = udiv ir<%tmp2>, ir<%tmp3> (S->V)
+; CHECK: Precomputed costs for VF 2: 4
----------------
david-arm wrote:

No. You can see this from the fact that even the precomputed costs don't match the total of costs we print out. This is one example that's missing:

```
  for (BasicBlock *BB : OrigLoop->blocks()) {
    if (CostCtx.skipCostComputation(BB->getTerminator(), VF.isVector()))
      continue;
    CostCtx.SkipCostComputation.insert(BB->getTerminator());
    if (BB == OrigLoop->getLoopLatch())
      continue;
    auto BranchCost = CostCtx.getLegacyCost(BB->getTerminator(), VF);
    Cost += BranchCost;
  }
```

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


More information about the llvm-commits mailing list