LLVM 19.0.0git
MachinePostDominators.h
Go to the documentation of this file.
1//===- llvm/CodeGen/MachinePostDominators.h ----------------------*- C++ -*-==//
2//
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
6//
7//===----------------------------------------------------------------------===//
8//
9// This file exposes interfaces to post dominance information for
10// target-specific code.
11//
12//===----------------------------------------------------------------------===//
13
14#ifndef LLVM_CODEGEN_MACHINEPOSTDOMINATORS_H
15#define LLVM_CODEGEN_MACHINEPOSTDOMINATORS_H
16
18
19namespace llvm {
20
21extern template class DominatorTreeBase<MachineBasicBlock, true>; // PostDomTree
22
23namespace DomTreeBuilder {
26
27extern template void Calculate<MBBPostDomTree>(MBBPostDomTree &DT);
28extern template void InsertEdge<MBBPostDomTree>(MBBPostDomTree &DT,
31extern template void DeleteEdge<MBBPostDomTree>(MBBPostDomTree &DT,
34extern template void ApplyUpdates<MBBPostDomTree>(MBBPostDomTree &DT,
37extern template bool
38Verify<MBBPostDomTree>(const MBBPostDomTree &DT,
40} // namespace DomTreeBuilder
41
42///
43/// MachinePostDominatorTree - an analysis pass wrapper for DominatorTree
44/// used to compute the post-dominator tree for MachineFunctions.
45///
48
49public:
51
52 /// Make findNearestCommonDominator(const NodeT *A, const NodeT *B) available.
53 using Base::findNearestCommonDominator;
54
55 /// Returns the nearest common dominator of the given blocks.
56 /// If that tree node is a virtual root, a nullptr will be returned.
58 findNearestCommonDominator(ArrayRef<MachineBasicBlock *> Blocks) const;
59};
60
62 std::optional<MachinePostDominatorTree> PDT;
63
64public:
65 static char ID;
66
68
70 const MachinePostDominatorTree &getPostDomTree() const { return *PDT; }
71
72 bool runOnMachineFunction(MachineFunction &MF) override;
73 void getAnalysisUsage(AnalysisUsage &AU) const override;
74 void releaseMemory() override { PDT.reset(); }
75 void verifyAnalysis() const override;
76 void print(llvm::raw_ostream &OS, const Module *M = nullptr) const override;
77};
78} //end of namespace llvm
79
80#endif
BlockVerifier::State From
DenseMap< Block *, BlockRelaxAux > Blocks
Definition: ELF_riscv.cpp:507
raw_pwrite_stream & OS
Represent the analysis usage information of a pass.
ArrayRef - Represent a constant reference to an array (0 or more elements consecutively in memory),...
Definition: ArrayRef.h:41
Core dominator tree base class.
MachineFunctionPass - This class adapts the FunctionPass interface to allow convenient creation of pa...
const MachinePostDominatorTree & getPostDomTree() const
void releaseMemory() override
releaseMemory() - This member can be implemented by a pass if it wants to be able to release its memo...
MachinePostDominatorTree - an analysis pass wrapper for DominatorTree used to compute the post-domina...
A Module instance is used to store all the information related to an LLVM module.
Definition: Module.h:65
This class implements an extremely fast bulk output stream that can only output to a stream.
Definition: raw_ostream.h:52
This is an optimization pass for GlobalISel generic memory operations.
Definition: AddressRanges.h:18
Printable print(const GCNRegPressure &RP, const GCNSubtarget *ST=nullptr)