LLVM
22.0.0git
include
llvm
CodeGen
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
17
#include "
llvm/Analysis/GenericDomTreeUpdater.h
"
18
#include "
llvm/CodeGen/MachineDominators.h
"
19
#include "
llvm/Support/Compiler.h
"
20
21
namespace
llvm
{
22
23
class
MachinePostDominatorTree
;
24
class
MachineDomTreeUpdater
;
25
26
extern
template
class
LLVM_TEMPLATE_ABI
GenericDomTreeUpdater
<
27
MachineDomTreeUpdater
,
MachineDominatorTree
,
MachinePostDominatorTree
>;
28
29
extern
template
LLVM_TEMPLATE_ABI
void
30
GenericDomTreeUpdater
<
MachineDomTreeUpdater
,
MachineDominatorTree
,
31
MachinePostDominatorTree
>::recalculate(
MachineFunction
32
&MF);
33
34
extern
template
LLVM_TEMPLATE_ABI
void
GenericDomTreeUpdater
<
35
MachineDomTreeUpdater
,
MachineDominatorTree
,
36
MachinePostDominatorTree
>::applyUpdatesImpl<
/*IsForward=*/
true
>();
37
extern
template
LLVM_TEMPLATE_ABI
void
GenericDomTreeUpdater
<
38
MachineDomTreeUpdater
,
MachineDominatorTree
,
39
MachinePostDominatorTree
>::applyUpdatesImpl<
/*IsForward=*/
false
>();
40
41
class
MachineDomTreeUpdater
42
:
public
GenericDomTreeUpdater
<MachineDomTreeUpdater, MachineDominatorTree,
43
MachinePostDominatorTree> {
44
friend
GenericDomTreeUpdater
<
MachineDomTreeUpdater
,
MachineDominatorTree
,
45
MachinePostDominatorTree
>;
46
47
public
:
48
using
Base
=
49
GenericDomTreeUpdater
<
MachineDomTreeUpdater
,
MachineDominatorTree
,
50
MachinePostDominatorTree
>;
51
using
Base::Base;
52
53
~MachineDomTreeUpdater
() {
flush
(); }
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.
66
LLVM_ABI
void
deleteBB
(
MachineBasicBlock
*DelBB);
67
68
///@}
69
70
private
:
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
Compiler.h
LLVM_ABI
#define LLVM_ABI
Definition
Compiler.h:213
LLVM_TEMPLATE_ABI
#define LLVM_TEMPLATE_ABI
Definition
Compiler.h:214
GenericDomTreeUpdater.h
MachineDominators.h
llvm::GenericDomTreeUpdater
Definition
GenericDomTreeUpdater.h:24
llvm::GenericDomTreeUpdater< MachineDomTreeUpdater, MachineDominatorTree, MachinePostDominatorTree >::flush
void flush()
Definition
GenericDomTreeUpdater.h:202
llvm::GenericDomTreeUpdater< MachineDomTreeUpdater, MachineDominatorTree, MachinePostDominatorTree >::GenericDomTreeUpdater
GenericDomTreeUpdater(UpdateStrategy Strategy_)
Definition
GenericDomTreeUpdater.h:35
llvm::MachineBasicBlock
Definition
MachineBasicBlock.h:122
llvm::MachineDomTreeUpdater
Definition
MachineDomTreeUpdater.h:43
llvm::MachineDomTreeUpdater::~MachineDomTreeUpdater
~MachineDomTreeUpdater()
Definition
MachineDomTreeUpdater.h:53
llvm::MachineDomTreeUpdater::Base
GenericDomTreeUpdater< MachineDomTreeUpdater, MachineDominatorTree, MachinePostDominatorTree > Base
Definition
MachineDomTreeUpdater.h:48
llvm::MachineDomTreeUpdater::deleteBB
LLVM_ABI void deleteBB(MachineBasicBlock *DelBB)
Delete DelBB.
Definition
MachineDomTreeUpdater.cpp:53
llvm::MachineDominatorTree
DominatorTree Class - Concrete subclass of DominatorTreeBase that is used to compute a normal dominat...
Definition
MachineDominators.h:71
llvm::MachineFunction
Definition
MachineFunction.h:286
llvm::MachinePostDominatorTree
MachinePostDominatorTree - an analysis pass wrapper for DominatorTree used to compute the post-domina...
Definition
MachinePostDominators.h:49
llvm
This is an optimization pass for GlobalISel generic memory operations.
Definition
AddressRanges.h:18
Generated on
for LLVM by
1.14.0