1 //===- MachineDominanceFrontier.cpp ---------------------------------------===//
3 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4 // See https://llvm.org/LICENSE.txt for license information.
5 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
7 //===----------------------------------------------------------------------===//
9 #include "llvm/CodeGen/MachineDominanceFrontier.h"
10 #include "llvm/CodeGen/MachineDominators.h"
11 #include "llvm/CodeGen/Passes.h"
12 #include "llvm/InitializePasses.h"
13 #include "llvm/Pass.h"
14 #include "llvm/PassRegistry.h"
19 template class DominanceFrontierBase
<MachineBasicBlock
, false>;
20 template class DominanceFrontierBase
<MachineBasicBlock
, true>;
21 template class ForwardDominanceFrontierBase
<MachineBasicBlock
>;
25 char MachineDominanceFrontier::ID
= 0;
27 INITIALIZE_PASS_BEGIN(MachineDominanceFrontier
, "machine-domfrontier",
28 "Machine Dominance Frontier Construction", true, true)
29 INITIALIZE_PASS_DEPENDENCY(MachineDominatorTree
)
30 INITIALIZE_PASS_END(MachineDominanceFrontier
, "machine-domfrontier",
31 "Machine Dominance Frontier Construction", true, true)
33 MachineDominanceFrontier::MachineDominanceFrontier() : MachineFunctionPass(ID
) {
34 initializeMachineDominanceFrontierPass(*PassRegistry::getPassRegistry());
37 char &llvm::MachineDominanceFrontierID
= MachineDominanceFrontier::ID
;
39 bool MachineDominanceFrontier::runOnMachineFunction(MachineFunction
&) {
41 Base
.analyze(getAnalysis
<MachineDominatorTree
>().getBase());
45 void MachineDominanceFrontier::releaseMemory() {
49 void MachineDominanceFrontier::getAnalysisUsage(AnalysisUsage
&AU
) const {
51 AU
.addRequired
<MachineDominatorTree
>();
52 MachineFunctionPass::getAnalysisUsage(AU
);