LLVM  12.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_SCALAR_SIMPLIFYCFGOPTIONS_H
17 #define LLVM_TRANSFORMS_SCALAR_SIMPLIFYCFGOPTIONS_H
18 
19 namespace llvm {
20 
21 class AssumptionCache;
22 
25  bool ForwardSwitchCondToPhi = false;
27  bool NeedCanonicalLoop = true;
28  bool SinkCommonInsts = false;
29  bool SimplifyCondBranch = true;
30  bool FoldTwoEntryPHINode = true;
31 
32  AssumptionCache *AC = nullptr;
33 
34  // Support 'builder' pattern to set members by name at construction time.
36  BonusInstThreshold = I;
37  return *this;
38  }
40  ForwardSwitchCondToPhi = B;
41  return *this;
42  }
44  ConvertSwitchToLookupTable = B;
45  return *this;
46  }
48  NeedCanonicalLoop = B;
49  return *this;
50  }
52  SinkCommonInsts = B;
53  return *this;
54  }
56  AC = Cache;
57  return *this;
58  }
60  SimplifyCondBranch = B;
61  return *this;
62  }
63 
65  FoldTwoEntryPHINode = B;
66  return *this;
67  }
68 };
69 
70 } // namespace llvm
71 
72 #endif // LLVM_TRANSFORMS_SCALAR_SIMPLIFYCFGOPTIONS_H
This class represents lattice values for constants.
Definition: AllocatorList.h:23
SimplifyCFGOptions & setSimplifyCondBranch(bool B)
SimplifyCFGOptions & bonusInstThreshold(int I)
SimplifyCFGOptions & sinkCommonInsts(bool B)
A cache of @llvm.assume calls within a function.
SimplifyCFGOptions & forwardSwitchCondToPhi(bool B)
SimplifyCFGOptions & setFoldTwoEntryPHINode(bool B)
SimplifyCFGOptions & convertSwitchToLookupTable(bool B)
static GCRegistry::Add< OcamlGC > B("ocaml", "ocaml 3.10-compatible GC")
SimplifyCFGOptions & needCanonicalLoops(bool B)
SimplifyCFGOptions & setAssumptionCache(AssumptionCache *Cache)
#define I(x, y, z)
Definition: MD5.cpp:59