Skip to content
Commit b30c9c93 authored by Matthias Braun's avatar Matthias Braun
Browse files

LoopUnrollRuntime: Add weights to all branches

Make sure every conditional branch constructed by `LoopUnrollRuntime`
code sets branch weights.

- Add new 1:127 weights for the conditional jumps checking whether the
  whole (unrolled) loop should be skipped in the generated prolog or
  epilog code.
- Remove `updateLatchBranchWeightsForRemainderLoop` function and just
  add weights immediately when constructing the relevant branches. This
  leads to simpler code and makes the code more obvious as every call
  to `CreateCondBr` now has a `BranchWeights` parameter.
- Rework formula for epilogue latch weights, to assume equal
  distribution of remainders and remove `assert` (as I was able to
  reach this code when forcing small unroll factors on the commandline).

Differential Revision: https://reviews.llvm.org/D158642
parent b8ede3ba
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment