BranchProb: modify the definition of an edge in BranchProbabilityInfo to handle
authorManman Ren <mren@apple.com>
Fri, 24 Aug 2012 18:14:27 +0000 (18:14 +0000)
committerManman Ren <mren@apple.com>
Fri, 24 Aug 2012 18:14:27 +0000 (18:14 +0000)
commit1a710fdde197b00107ef55df51054925b9a5d2a2
treed9508714f288a9cf07342120f246ced6245d10e1
parent91f8dc9baeb35d5812a797d733e689120e041fef
BranchProb: modify the definition of an edge in BranchProbabilityInfo to handle
the case of multiple edges from one block to another.

A simple example is a switch statement with multiple values to the same
destination. The definition of an edge is modified from a pair of blocks to
a pair of PredBlock and an index into the successors.

Also set the weight correctly when building SelectionDAG from LLVM IR,
especially when converting a Switch.
IntegersSubsetMapping is updated to calculate the weight for each cluster.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@162572 91177308-0d34-0410-b5e6-96231b3b80d8
include/llvm/Analysis/BranchProbabilityInfo.h
include/llvm/Support/IntegersSubsetMapping.h
lib/Analysis/BranchProbabilityInfo.cpp
lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp
lib/CodeGen/SelectionDAG/SelectionDAGBuilder.h
lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp
test/Analysis/BranchProbabilityInfo/basic.ll
test/CodeGen/Generic/MachineBranchProb.ll [new file with mode: 0644]