LLVM
17.0.0git
include
llvm
CodeGen
UnreachableBlockElim.h
Go to the documentation of this file.
1
//===-- UnreachableBlockElim.h - Remove unreachable blocks for codegen --===//
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 pass is an extremely simple version of the SimplifyCFG pass. Its sole
10
// job is to delete LLVM basic blocks that are not reachable from the entry
11
// node. To do this, it performs a simple depth first traversal of the CFG,
12
// then deletes any unvisited nodes.
13
//
14
// Note that this pass is really a hack. In particular, the instruction
15
// selectors for various targets should just not generate code for unreachable
16
// blocks. Until LLVM has a more systematic way of defining instruction
17
// selectors, however, we cannot really expect them to handle additional
18
// complexity.
19
//
20
//===----------------------------------------------------------------------===//
21
22
#ifndef LLVM_CODEGEN_UNREACHABLEBLOCKELIM_H
23
#define LLVM_CODEGEN_UNREACHABLEBLOCKELIM_H
24
25
#include "
llvm/IR/PassManager.h
"
26
27
namespace
llvm
{
28
29
class
UnreachableBlockElimPass
30
:
public
PassInfoMixin
<UnreachableBlockElimPass> {
31
public
:
32
PreservedAnalyses
run
(
Function
&
F
,
FunctionAnalysisManager
&AM);
33
};
34
}
// end namespace llvm
35
36
#endif // LLVM_CODEGEN_UNREACHABLEBLOCKELIM_H
llvm::PreservedAnalyses
A set of analyses that are preserved following a run of a transformation pass.
Definition:
PassManager.h:152
llvm
This is an optimization pass for GlobalISel generic memory operations.
Definition:
AddressRanges.h:18
llvm::PassInfoMixin
A CRTP mix-in to automatically provide informational APIs needed for passes.
Definition:
PassManager.h:371
llvm::Function
Definition:
Function.h:59
F
#define F(x, y, z)
Definition:
MD5.cpp:55
llvm::UnreachableBlockElimPass::run
PreservedAnalyses run(Function &F, FunctionAnalysisManager &AM)
Definition:
UnreachableBlockElim.cpp:64
llvm::UnreachableBlockElimPass
Definition:
UnreachableBlockElim.h:29
PassManager.h
llvm::AnalysisManager
A container for analyses that lazily runs them and caches their results.
Definition:
InstructionSimplify.h:42
Generated on Sat Jan 28 2023 08:45:44 for LLVM by
1.8.17