[all-commits] [llvm/llvm-project] a9cc6f: LoopVectorize: Set branch_weight for conditional b...

Matthias Braun via All-commits all-commits at lists.llvm.org
Thu Nov 16 11:33:59 PST 2023


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: a9cc6fc28078de3e0391b477505c2d3d84f52e4b
      https://github.com/llvm/llvm-project/commit/a9cc6fc28078de3e0391b477505c2d3d84f52e4b
  Author: Matthias Braun <matze at braunis.de>
  Date:   2023-11-16 (Thu, 16 Nov 2023)

  Changed paths:
    M llvm/lib/Transforms/Vectorize/LoopVectorize.cpp
    A llvm/test/Transforms/LoopVectorize/branch-weights.ll
    M llvm/test/Transforms/LoopVectorize/first-order-recurrence.ll

  Log Message:
  -----------
  LoopVectorize: Set branch_weight for conditional branches (#72450)

Consistently add `branch_weights` metadata in any condition branch
created by `LoopVectorize.cpp`:
- Will only add metadata if the original loop-latch branch had metadata
assigned.
- Most checks should rarely trigger so I am using a 127:1 ratio.
- For the middle block we assume an equal distribution of modulo
results.




More information about the All-commits mailing list