OSDN Git Service

Teach the BranchProbabilityInfo analysis pass to read any metadata
authorChandler Carruth <chandlerc@gmail.com>
Wed, 19 Oct 2011 10:30:30 +0000 (10:30 +0000)
committerChandler Carruth <chandlerc@gmail.com>
Wed, 19 Oct 2011 10:30:30 +0000 (10:30 +0000)
commit99d01c54a0fd790a48d5aa02bfeb4cc08388b8fa
treef937b9c7d85eece81dbc1f73370dfb26006570ae
parent6aa5c26c81071e22a23a6f0ae7dcac6080ad6597
Teach the BranchProbabilityInfo analysis pass to read any metadata
encoding of probabilities. In the absense of metadata, it continues to
fall back on static heuristics.

This allows __builtin_expect, after lowering through llvm.expect
a branch instruction's metadata, to actually enter the branch
probability model. This is one component of resolving PR2577.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@142492 91177308-0d34-0410-b5e6-96231b3b80d8
lib/Analysis/BranchProbabilityInfo.cpp
test/Analysis/BlockFrequencyInfo/basic.ll