Fix the API usage in loop probability heuristics. It was incorrectly
authorChandler Carruth <chandlerc@gmail.com>
Tue, 25 Oct 2011 09:47:41 +0000 (09:47 +0000)
committerChandler Carruth <chandlerc@gmail.com>
Tue, 25 Oct 2011 09:47:41 +0000 (09:47 +0000)
commit45baf6bb85ee0d61e18213979a4efbd2f16eb338
tree9729dbd510b378815342f2111a5c47901479a07f
parent526c80bae4d9902fea9efd787c2f212bf111e85e
Fix the API usage in loop probability heuristics. It was incorrectly
classifying many edges as exiting which were in fact not. These mainly
formed edges into sub-loops. It was also not correctly classifying all
returning edges out of loops as leaving the loop. With this match most
of the loop heuristics are more rational.

Several serious regressions on loop-intesive benchmarks like perlbench's
loop tests when built with -enable-block-placement are fixed by these
updated heuristics. Unfortunately they in turn uncover some other
regressions. There are still several improvemenst that should be made to
loop heuristics including trip-count, and early back-edge management.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@142917 91177308-0d34-0410-b5e6-96231b3b80d8
lib/Analysis/BranchProbabilityInfo.cpp
test/Analysis/BranchProbabilityInfo/loop.ll [new file with mode: 0644]