Let SelectionDAG start to use probability-based interface to add successors.
authorCong Hou <congh@google.com>
Tue, 24 Nov 2015 08:51:23 +0000 (08:51 +0000)
committerCong Hou <congh@google.com>
Tue, 24 Nov 2015 08:51:23 +0000 (08:51 +0000)
commitfc33b8bb31225185b2d4079884cf8af7b5447935
tree8e320af504e03968e3035d3decb94137fa01b131
parent20faa148c7abff5457fb3ea20013b379e5572c33
Let SelectionDAG start to use probability-based interface to add successors.

The patch in http://reviews.llvm.org/D13745 is broken into four parts:

1. New interfaces without functional changes.
2. Use new interfaces in SelectionDAG, while in other passes treat probabilities
as weights.
3. Use new interfaces in all other passes.
4. Remove old interfaces.

This the second patch above. In this patch SelectionDAG starts to use
probability-based interfaces in MBB to add successors but other MC passes are
still using weight-based interfaces. Therefore, we need to maintain correct
weight list in MBB even when probability-based interfaces are used. This is
done by updating weight list in probability-based interfaces by treating the
numerator of probabilities as weights. This change affects many test cases
that check successor weight values. I will update those test cases once this
patch looks good to you.

Differential revision: http://reviews.llvm.org/D14361

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@253965 91177308-0d34-0410-b5e6-96231b3b80d8
23 files changed:
include/llvm/Analysis/BranchProbabilityInfo.h
include/llvm/Support/BranchProbability.h
lib/CodeGen/MachineBasicBlock.cpp
lib/CodeGen/SelectionDAG/FastISel.cpp
lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp
lib/CodeGen/SelectionDAG/SelectionDAGBuilder.h
lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp
lib/Target/AArch64/AArch64FastISel.cpp
lib/Target/Mips/MipsDelaySlotFiller.cpp
lib/Target/PowerPC/PPCISelLowering.cpp
lib/Target/X86/X86FrameLowering.cpp
test/CodeGen/ARM/ifcvt-branch-weight-bug.ll
test/CodeGen/ARM/ifcvt-branch-weight.ll
test/CodeGen/ARM/ifcvt-iter-indbr.ll
test/CodeGen/ARM/taildup-branch-weight.ll
test/CodeGen/Generic/MachineBranchProb.ll
test/CodeGen/Hexagon/ifcvt-edge-weight.ll
test/CodeGen/PowerPC/sjlj.ll
test/CodeGen/X86/MachineBranchProb.ll
test/CodeGen/X86/catchpad-weight.ll
test/CodeGen/X86/stack-protector-weight.ll
test/CodeGen/X86/switch-edge-weight.ll
test/CodeGen/X86/switch-jump-table.ll