LLVM 20.0.0git
SimplifyCFGOptions.h
Go to the documentation of this file.
1//===- SimplifyCFGOptions.h - Control structure for SimplifyCFG -*- 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// A set of parameters used to control the transforms in the SimplifyCFG pass.
10// Options may change depending on the position in the optimization pipeline.
11// For example, canonical form that includes switches and branches may later be
12// replaced by lookup tables and selects.
13//
14//===----------------------------------------------------------------------===//
15
16#ifndef LLVM_TRANSFORMS_UTILS_SIMPLIFYCFGOPTIONS_H
17#define LLVM_TRANSFORMS_UTILS_SIMPLIFYCFGOPTIONS_H
18
19namespace llvm {
20
21class AssumptionCache;
22
28 bool NeedCanonicalLoop = true;
29 bool HoistCommonInsts = false;
31 bool SinkCommonInsts = false;
32 bool SimplifyCondBranch = true;
33 bool SpeculateBlocks = true;
35
36 AssumptionCache *AC = nullptr;
37
38 // Support 'builder' pattern to set members by name at construction time.
41 return *this;
42 }
45 return *this;
46 }
49 return *this;
50 }
53 return *this;
54 }
57 return *this;
58 }
61 return *this;
62 }
65 return *this;
66 }
69 return *this;
70 }
72 AC = Cache;
73 return *this;
74 }
77 return *this;
78 }
79
82 return *this;
83 }
86 return *this;
87 }
88};
89
90} // namespace llvm
91
92#endif // LLVM_TRANSFORMS_UTILS_SIMPLIFYCFGOPTIONS_H
static GCRegistry::Add< OcamlGC > B("ocaml", "ocaml 3.10-compatible GC")
#define I(x, y, z)
Definition: MD5.cpp:58
A cache of @llvm.assume calls within a function.
This is an optimization pass for GlobalISel generic memory operations.
Definition: AddressRanges.h:18
SimplifyCFGOptions & setSimplifyCondBranch(bool B)
SimplifyCFGOptions & sinkCommonInsts(bool B)
SimplifyCFGOptions & convertSwitchRangeToICmp(bool B)
SimplifyCFGOptions & speculateUnpredictables(bool B)
SimplifyCFGOptions & convertSwitchToLookupTable(bool B)
SimplifyCFGOptions & hoistCommonInsts(bool B)
SimplifyCFGOptions & speculateBlocks(bool B)
SimplifyCFGOptions & bonusInstThreshold(int I)
SimplifyCFGOptions & setAssumptionCache(AssumptionCache *Cache)
SimplifyCFGOptions & needCanonicalLoops(bool B)
SimplifyCFGOptions & forwardSwitchCondToPhi(bool B)
SimplifyCFGOptions & hoistLoadsStoresWithCondFaulting(bool B)