LLVM 22.0.0git
MachineDomTreeUpdater.h
Go to the documentation of this file.
1//===- llvm/CodeGen/MachineDomTreeUpdater.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_MACHINEDOMTREEUPDATER_H
15#define LLVM_CODEGEN_MACHINEDOMTREEUPDATER_H
16
20
21namespace llvm {
22
25
26extern template class LLVM_TEMPLATE_ABI GenericDomTreeUpdater<
28
29extern template LLVM_TEMPLATE_ABI void
32 &MF);
33
34extern template LLVM_TEMPLATE_ABI void GenericDomTreeUpdater<
36 MachinePostDominatorTree>::applyUpdatesImpl</*IsForward=*/true>();
37extern template LLVM_TEMPLATE_ABI void GenericDomTreeUpdater<
39 MachinePostDominatorTree>::applyUpdatesImpl</*IsForward=*/false>();
40
42 : public GenericDomTreeUpdater<MachineDomTreeUpdater, MachineDominatorTree,
43 MachinePostDominatorTree> {
46
47public:
48 using Base =
51 using Base::Base;
52
54
55 ///@{
56 /// \name Mutation APIs
57 ///
58
59 /// Delete DelBB. DelBB will be removed from its Parent and
60 /// erased from available trees if it exists and finally get deleted.
61 /// Under Eager UpdateStrategy, DelBB will be processed immediately.
62 /// Under Lazy UpdateStrategy, DelBB will be queued until a flush event and
63 /// all available trees are up-to-date. Assert if any instruction of DelBB is
64 /// modified while awaiting deletion. When both DT and PDT are nullptrs, DelBB
65 /// will be queued until flush() is called.
67
68 ///@}
69
70private:
71 /// First remove all the instructions of DelBB and then make sure DelBB has a
72 /// valid terminator instruction which is necessary to have when DelBB still
73 /// has to be inside of its parent Function while awaiting deletion under Lazy
74 /// UpdateStrategy to prevent other routines from asserting the state of the
75 /// IR is inconsistent. Assert if DelBB is nullptr or has predecessors.
76 void validateDeleteBB(MachineBasicBlock *DelBB);
77
78 /// Returns true if at least one MachineBasicBlock is deleted.
79 bool forceFlushDeletedBB();
80};
81} // namespace llvm
82#endif // LLVM_CODEGEN_MACHINEDOMTREEUPDATER_H
#define LLVM_ABI
Definition Compiler.h:213
#define LLVM_TEMPLATE_ABI
Definition Compiler.h:214
GenericDomTreeUpdater< MachineDomTreeUpdater, MachineDominatorTree, MachinePostDominatorTree > Base
LLVM_ABI void deleteBB(MachineBasicBlock *DelBB)
Delete DelBB.
DominatorTree Class - Concrete subclass of DominatorTreeBase that is used to compute a normal dominat...
MachinePostDominatorTree - an analysis pass wrapper for DominatorTree used to compute the post-domina...
This is an optimization pass for GlobalISel generic memory operations.