diff options
| author | Cong Hou <congh@google.com> | 2015-11-24 08:51:23 +0000 |
|---|---|---|
| committer | Cong Hou <congh@google.com> | 2015-11-24 08:51:23 +0000 |
| commit | 1938f2eb9832978952f6a6397a5ad40c6338ed6e (patch) | |
| tree | bb573a7986c8a72e20f561c9893e437f7ae8e4f6 /llvm/lib/Target/AArch64/AArch64FastISel.cpp | |
| parent | 5712d4611418742c5c4eec394675dd00867d1470 (diff) | |
| download | bcm5719-llvm-1938f2eb9832978952f6a6397a5ad40c6338ed6e.tar.gz bcm5719-llvm-1938f2eb9832978952f6a6397a5ad40c6338ed6e.zip | |
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
llvm-svn: 253965
Diffstat (limited to 'llvm/lib/Target/AArch64/AArch64FastISel.cpp')
| -rw-r--r-- | llvm/lib/Target/AArch64/AArch64FastISel.cpp | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/llvm/lib/Target/AArch64/AArch64FastISel.cpp b/llvm/lib/Target/AArch64/AArch64FastISel.cpp index 284f5263f90..b7849d5bbc2 100644 --- a/llvm/lib/Target/AArch64/AArch64FastISel.cpp +++ b/llvm/lib/Target/AArch64/AArch64FastISel.cpp @@ -2375,13 +2375,13 @@ bool AArch64FastISel::selectBranch(const Instruction *I) { BuildMI(*FuncInfo.MBB, FuncInfo.InsertPt, DbgLoc, TII.get(AArch64::B)) .addMBB(Target); - // Obtain the branch weight and add the target to the successor list. + // Obtain the branch probability and add the target to the successor list. if (FuncInfo.BPI) { - uint32_t BranchWeight = - FuncInfo.BPI->getEdgeWeight(BI->getParent(), Target->getBasicBlock()); - FuncInfo.MBB->addSuccessor(Target, BranchWeight); + auto BranchProbability = FuncInfo.BPI->getEdgeProbability( + BI->getParent(), Target->getBasicBlock()); + FuncInfo.MBB->addSuccessor(Target, BranchProbability); } else - FuncInfo.MBB->addSuccessorWithoutWeight(Target); + FuncInfo.MBB->addSuccessorWithoutProb(Target); return true; } else if (foldXALUIntrinsic(CC, I, BI->getCondition())) { // Fake request the condition, otherwise the intrinsic might be completely |

