From ef33edd9b5e321a7248f30b7c9d1794039013b8b Mon Sep 17 00:00:00 2001 From: Jakub Kuderski Date: Wed, 23 May 2018 17:29:21 +0000 Subject: [Dominators] Add PDT constructor from Function Summary: This patch adds a PDT constructor from Function and lets codes previously using a local class to do this use PostDominatorTree class directly. Reviewers: davide, kuhar, grosser, dberlin Reviewed By: kuhar Author: NutshellySima Subscribers: llvm-commits Differential Revision: https://reviews.llvm.org/D46709 llvm-svn: 333102 --- llvm/lib/Transforms/IPO/SampleProfile.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'llvm/lib/Transforms/IPO') diff --git a/llvm/lib/Transforms/IPO/SampleProfile.cpp b/llvm/lib/Transforms/IPO/SampleProfile.cpp index 945c660aa78..1c53a82cf8a 100644 --- a/llvm/lib/Transforms/IPO/SampleProfile.cpp +++ b/llvm/lib/Transforms/IPO/SampleProfile.cpp @@ -37,6 +37,7 @@ #include "llvm/Analysis/InlineCost.h" #include "llvm/Analysis/LoopInfo.h" #include "llvm/Analysis/OptimizationRemarkEmitter.h" +#include "llvm/Analysis/PostDominators.h" #include "llvm/Analysis/ProfileSummaryInfo.h" #include "llvm/Analysis/TargetTransformInfo.h" #include "llvm/IR/BasicBlock.h" @@ -253,7 +254,7 @@ protected: /// Dominance, post-dominance and loop information. std::unique_ptr DT; - std::unique_ptr> PDT; + std::unique_ptr PDT; std::unique_ptr LI; std::function GetAC; @@ -1365,8 +1366,7 @@ void SampleProfileLoader::computeDominanceAndLoopInfo(Function &F) { DT.reset(new DominatorTree); DT->recalculate(F); - PDT.reset(new PostDomTreeBase()); - PDT->recalculate(F); + PDT.reset(new PostDominatorTree(F)); LI.reset(new LoopInfo); LI->analyze(*DT); -- cgit v1.2.3