Thanks to visit codestin.com
Credit goes to llvm.org

LLVM 22.0.0git
SimplifyCFG.h
Go to the documentation of this file.
1//===- SimplifyCFG.h - Simplify and canonicalize the CFG --------*- 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/// \file
9/// This file provides the interface for the pass responsible for both
10/// simplifying and canonicalizing the CFG.
11///
12//===----------------------------------------------------------------------===//
13
14#ifndef LLVM_TRANSFORMS_SCALAR_SIMPLIFYCFG_H
15#define LLVM_TRANSFORMS_SCALAR_SIMPLIFYCFG_H
16
17#include "llvm/IR/Function.h"
18#include "llvm/IR/PassManager.h"
21
22namespace llvm {
23
24/// A pass to simplify and canonicalize the CFG of a function.
25///
26/// This pass iteratively simplifies the entire CFG of a function. It may change
27/// or remove control flow to put the CFG into a canonical form expected by
28/// other passes of the mid-level optimizer. Depending on the specified options,
29/// it may further optimize control-flow to create non-canonical forms.
30class SimplifyCFGPass : public PassInfoMixin<SimplifyCFGPass> {
31 SimplifyCFGOptions Options;
32
33public:
34 /// The default constructor sets the pass options to create canonical IR,
35 /// rather than optimal IR. That is, by default we bypass transformations that
36 /// are likely to improve performance but make analysis for other passes more
37 /// difficult.
39
40 /// Construct a pass with optional optimizations.
42
43 /// Run the pass over the function.
45
46 LLVM_ABI void
48 function_ref<StringRef(StringRef)> MapClassName2PassName);
49};
50
51}
52
53#endif
#define LLVM_ABI
Definition Compiler.h:213
This header defines various interfaces for pass management in LLVM.
#define F(x, y, z)
Definition MD5.cpp:55
A set of analyses that are preserved following a run of a transformation pass.
Definition Analysis.h:112
LLVM_ABI PreservedAnalyses run(Function &F, FunctionAnalysisManager &AM)
Run the pass over the function.
LLVM_ABI SimplifyCFGPass()
The default constructor sets the pass options to create canonical IR, rather than optimal IR.
LLVM_ABI void printPipeline(raw_ostream &OS, function_ref< StringRef(StringRef)> MapClassName2PassName)
StringRef - Represent a constant reference to a string, i.e.
Definition StringRef.h:55
An efficient, type-erasing, non-owning reference to a callable.
This class implements an extremely fast bulk output stream that can only output to a stream.
Definition raw_ostream.h:53
This is an optimization pass for GlobalISel generic memory operations.
AnalysisManager< Function > FunctionAnalysisManager
Convenience typedef for the Function analysis manager.
A CRTP mix-in to automatically provide informational APIs needed for passes.
Definition PassManager.h:70