LLVM
20.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
20
namespace
llvm
{
21
22
class
MachinePostDominatorTree;
23
24
class
MachineDomTreeUpdater
25
:
public
GenericDomTreeUpdater
<MachineDomTreeUpdater, MachineDominatorTree,
26
MachinePostDominatorTree> {
27
friend
GenericDomTreeUpdater
<
MachineDomTreeUpdater
,
MachineDominatorTree
,
28
MachinePostDominatorTree
>;
29
30
public
:
31
using
Base
=
32
GenericDomTreeUpdater
<
MachineDomTreeUpdater
,
MachineDominatorTree
,
33
MachinePostDominatorTree
>;
34
using
Base::Base;
35
36
~MachineDomTreeUpdater
() {
flush
(); }
37
38
///@{
39
/// \name Mutation APIs
40
///
41
42
/// Delete DelBB. DelBB will be removed from its Parent and
43
/// erased from available trees if it exists and finally get deleted.
44
/// Under Eager UpdateStrategy, DelBB will be processed immediately.
45
/// Under Lazy UpdateStrategy, DelBB will be queued until a flush event and
46
/// all available trees are up-to-date. Assert if any instruction of DelBB is
47
/// modified while awaiting deletion. When both DT and PDT are nullptrs, DelBB
48
/// will be queued until flush() is called.
49
void
deleteBB
(
MachineBasicBlock
*DelBB);
50
51
///@}
52
53
private
:
54
/// First remove all the instructions of DelBB and then make sure DelBB has a
55
/// valid terminator instruction which is necessary to have when DelBB still
56
/// has to be inside of its parent Function while awaiting deletion under Lazy
57
/// UpdateStrategy to prevent other routines from asserting the state of the
58
/// IR is inconsistent. Assert if DelBB is nullptr or has predecessors.
59
void
validateDeleteBB(
MachineBasicBlock
*DelBB);
60
61
/// Returns true if at least one MachineBasicBlock is deleted.
62
bool
forceFlushDeletedBB();
63
};
64
65
extern
template
class
GenericDomTreeUpdater<
66
MachineDomTreeUpdater, MachineDominatorTree, MachinePostDominatorTree>;
67
68
extern
template
void
69
GenericDomTreeUpdater<MachineDomTreeUpdater, MachineDominatorTree,
70
MachinePostDominatorTree>::recalculate(MachineFunction
71
&MF);
72
}
// namespace llvm
73
#endif
// LLVM_CODEGEN_MACHINEDOMTREEUPDATER_H
GenericDomTreeUpdater.h
MachineDominators.h
llvm::GenericDomTreeUpdater
Definition:
GenericDomTreeUpdater.h:24
llvm::GenericDomTreeUpdater< MachineDomTreeUpdater, MachineDominatorTree, MachinePostDominatorTree >::flush
void flush()
Apply all pending updates to available trees and flush all BasicBlocks awaiting deletion.
Definition:
GenericDomTreeUpdater.h:196
llvm::MachineBasicBlock
Definition:
MachineBasicBlock.h:124
llvm::MachineDomTreeUpdater
Definition:
MachineDomTreeUpdater.h:26
llvm::MachineDomTreeUpdater::~MachineDomTreeUpdater
~MachineDomTreeUpdater()
Definition:
MachineDomTreeUpdater.h:36
llvm::MachineDomTreeUpdater::deleteBB
void deleteBB(MachineBasicBlock *DelBB)
Delete DelBB.
Definition:
MachineDomTreeUpdater.cpp:50
llvm::MachineDominatorTree
DominatorTree Class - Concrete subclass of DominatorTreeBase that is used to compute a normal dominat...
Definition:
MachineDominators.h:75
llvm::MachinePostDominatorTree
MachinePostDominatorTree - an analysis pass wrapper for DominatorTree used to compute the post-domina...
Definition:
MachinePostDominators.h:46
llvm
This is an optimization pass for GlobalISel generic memory operations.
Definition:
AddressRanges.h:18
Generated on Mon Nov 4 2024 10:51:57 for LLVM by
1.9.6