aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/CodeGen/BranchFolding.cpp
diff options
context:
space:
mode:
authorpaperchalice <liujunchang97@outlook.com>2024-06-27 14:04:51 +0800
committerGitHub <noreply@github.com>2024-06-27 14:04:51 +0800
commit73e46c2bb4949be986d9eac98d95a206d7f003e2 (patch)
tree44cc09d96c2b0c9c1011e1124da0e5f89d6ab1bf /llvm/lib/CodeGen/BranchFolding.cpp
parent73e6f9f95b51d7be1f93deded219005027f8d270 (diff)
downloadllvm-73e46c2bb4949be986d9eac98d95a206d7f003e2.zip
llvm-73e46c2bb4949be986d9eac98d95a206d7f003e2.tar.gz
llvm-73e46c2bb4949be986d9eac98d95a206d7f003e2.tar.bz2
[CodeGen][NewPM] Port machine-branch-prob to new pass manager (#96389)
Like IR version `print<branch-prob>`, there is also a `print<machine-branch-prob>`.
Diffstat (limited to 'llvm/lib/CodeGen/BranchFolding.cpp')
-rw-r--r--llvm/lib/CodeGen/BranchFolding.cpp9
1 files changed, 5 insertions, 4 deletions
diff --git a/llvm/lib/CodeGen/BranchFolding.cpp b/llvm/lib/CodeGen/BranchFolding.cpp
index c6c48cf..1b6a6ee 100644
--- a/llvm/lib/CodeGen/BranchFolding.cpp
+++ b/llvm/lib/CodeGen/BranchFolding.cpp
@@ -99,7 +99,7 @@ namespace {
void getAnalysisUsage(AnalysisUsage &AU) const override {
AU.addRequired<MachineBlockFrequencyInfo>();
- AU.addRequired<MachineBranchProbabilityInfo>();
+ AU.addRequired<MachineBranchProbabilityInfoWrapperPass>();
AU.addRequired<ProfileSummaryInfoWrapperPass>();
AU.addRequired<TargetPassConfig>();
MachineFunctionPass::getAnalysisUsage(AU);
@@ -131,9 +131,10 @@ bool BranchFolderPass::runOnMachineFunction(MachineFunction &MF) {
PassConfig->getEnableTailMerge();
MBFIWrapper MBBFreqInfo(
getAnalysis<MachineBlockFrequencyInfo>());
- BranchFolder Folder(EnableTailMerge, /*CommonHoist=*/true, MBBFreqInfo,
- getAnalysis<MachineBranchProbabilityInfo>(),
- &getAnalysis<ProfileSummaryInfoWrapperPass>().getPSI());
+ BranchFolder Folder(
+ EnableTailMerge, /*CommonHoist=*/true, MBBFreqInfo,
+ getAnalysis<MachineBranchProbabilityInfoWrapperPass>().getMBPI(),
+ &getAnalysis<ProfileSummaryInfoWrapperPass>().getPSI());
return Folder.OptimizeFunction(MF, MF.getSubtarget().getInstrInfo(),
MF.getSubtarget().getRegisterInfo());
}