[PATCH] D10979: Update the branch weight metadata in JumpThreading pass.

Xinliang David Li davidxl at google.com
Tue Jul 7 13:08:27 PDT 2015


Weights are relative values that can only be compared/mixed across
branches sharing the same  source BB. For Jump-thread updating, the
split-out edge from NewBB to SuccBB is a new edge without profile
info. We need to use the profile info from edge Pred -> NewBB which
does not share the same source BB with BB->SuccBB. Frequency needs to
be used for scaling purpose here.

David

On Tue, Jul 7, 2015 at 11:37 AM, Diego Novillo <dnovillo at google.com> wrote:
> dnovillo added a subscriber: dnovillo.
>
> ================
> Comment at: lib/Transforms/Scalar/JumpThreading.cpp:1522
> @@ +1521,3 @@
> +  // Freq(BB->SuccBB).
> +  SmallVector<uint32_t, 8> Weights;
> +  auto TI = BB->getTerminator();
> ----------------
> Shouldn't you be using weights here instead of frequencies? Frequencies can be computed later out of the branch weights.
>
>
> http://reviews.llvm.org/D10979
>
>
>



More information about the llvm-commits mailing list