[llvm] [LV][NFC] Add branch weight test showing incorrect behaviour (PR #144682)

Florian Hahn via llvm-commits llvm-commits at lists.llvm.org
Wed Jun 18 10:59:59 PDT 2025


================
@@ -7682,6 +7682,8 @@ EpilogueVectorizerEpilogueLoop::emitMinimumVectorEpilogueIterCountCheck(
   BranchInst &BI =
       *BranchInst::Create(Bypass, LoopVectorPreHeader, CheckMinIters);
   if (hasBranchWeightMD(*OrigLoop->getLoopLatch()->getTerminator())) {
+    // FIXME: See test Transforms/LoopVectorize/branch-weights.ll. I don't
+    // think the MainLoopStep is correct.
----------------
fhahn wrote:

```suggestion
    // FIXME: UF and VF are the same as EPI.EpilogueUF and EPI.EpilogueVF, so MainLoopStep is the same as EpilogueLoopStep. See test Transforms/LoopVectorize/branch-weights.ll.
```

Yes they definitely are the same, as we are in `EpilogueVectorizerEpilogueLoop`

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


More information about the llvm-commits mailing list