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

Cong Hou congh at google.com
Mon Jul 6 17:22:14 PDT 2015


congh added reviewers: chandlerc, davidxl.
congh added a subscriber: llvm-commits.

Currently in JumpThreading pass, the branch weight metadata is not updated after CFG modification. Consider the jump threading on PredBB, BB, and SuccBB. After jump threading, the weight on BB->SuccBB should be adjusted as some of it is contributed by the edge PredBB->BB, which doesn't exist anymore. This patch tries to update the edge weight in metadata on BB->SuccBB by scaling it by 1 - Freq(PredBB->BB) / Freq(BB->SuccBB). Two more analyses (BlockFrequencyInfo and BranchProbabilityInfo) are needed then.

http://reviews.llvm.org/D10979

Files:
  lib/Transforms/Scalar/JumpThreading.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D10979.29140.patch
Type: text/x-patch
Size: 4137 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20150707/56ba8624/attachment.bin>


More information about the llvm-commits mailing list