LLVM  14.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 
19 namespace llvm {
20 
21 class AssumptionCache;
22 
25  bool ForwardSwitchCondToPhi = false;
27  bool NeedCanonicalLoop = true;
28  bool HoistCommonInsts = false;
29  bool SinkCommonInsts = false;
30  bool SimplifyCondBranch = true;
31  bool FoldTwoEntryPHINode = true;
32 
33  AssumptionCache *AC = nullptr;
34 
35  // Support 'builder' pattern to set members by name at construction time.
38  return *this;
39  }
42  return *this;
43  }
46  return *this;
47  }
50  return *this;
51  }
54  return *this;
55  }
58  return *this;
59  }
61  AC = Cache;
62  return *this;
63  }
66  return *this;
67  }
68 
71  return *this;
72  }
73 };
74 
75 } // namespace llvm
76 
77 #endif // LLVM_TRANSFORMS_UTILS_SIMPLIFYCFGOPTIONS_H
llvm
This file implements support for optimizing divisions by a constant.
Definition: AllocatorList.h:23
llvm::SimplifyCFGOptions::setFoldTwoEntryPHINode
SimplifyCFGOptions & setFoldTwoEntryPHINode(bool B)
Definition: SimplifyCFGOptions.h:69
llvm::SimplifyCFGOptions::hoistCommonInsts
SimplifyCFGOptions & hoistCommonInsts(bool B)
Definition: SimplifyCFGOptions.h:52
llvm::SimplifyCFGOptions::BonusInstThreshold
int BonusInstThreshold
Definition: SimplifyCFGOptions.h:24
llvm::SimplifyCFGOptions::ConvertSwitchToLookupTable
bool ConvertSwitchToLookupTable
Definition: SimplifyCFGOptions.h:26
llvm::SimplifyCFGOptions::FoldTwoEntryPHINode
bool FoldTwoEntryPHINode
Definition: SimplifyCFGOptions.h:31
llvm::SimplifyCFGOptions::HoistCommonInsts
bool HoistCommonInsts
Definition: SimplifyCFGOptions.h:28
llvm::SimplifyCFGOptions::SimplifyCondBranch
bool SimplifyCondBranch
Definition: SimplifyCFGOptions.h:30
llvm::SimplifyCFGOptions::setSimplifyCondBranch
SimplifyCFGOptions & setSimplifyCondBranch(bool B)
Definition: SimplifyCFGOptions.h:64
llvm::SimplifyCFGOptions::AC
AssumptionCache * AC
Definition: SimplifyCFGOptions.h:33
B
static GCRegistry::Add< OcamlGC > B("ocaml", "ocaml 3.10-compatible GC")
llvm::SimplifyCFGOptions::bonusInstThreshold
SimplifyCFGOptions & bonusInstThreshold(int I)
Definition: SimplifyCFGOptions.h:36
llvm::SimplifyCFGOptions::sinkCommonInsts
SimplifyCFGOptions & sinkCommonInsts(bool B)
Definition: SimplifyCFGOptions.h:56
llvm::SimplifyCFGOptions::forwardSwitchCondToPhi
SimplifyCFGOptions & forwardSwitchCondToPhi(bool B)
Definition: SimplifyCFGOptions.h:40
I
#define I(x, y, z)
Definition: MD5.cpp:59
llvm::SimplifyCFGOptions::setAssumptionCache
SimplifyCFGOptions & setAssumptionCache(AssumptionCache *Cache)
Definition: SimplifyCFGOptions.h:60
llvm::SimplifyCFGOptions::NeedCanonicalLoop
bool NeedCanonicalLoop
Definition: SimplifyCFGOptions.h:27
llvm::SimplifyCFGOptions::convertSwitchToLookupTable
SimplifyCFGOptions & convertSwitchToLookupTable(bool B)
Definition: SimplifyCFGOptions.h:44
llvm::AssumptionCache
A cache of @llvm.assume calls within a function.
Definition: AssumptionCache.h:41
llvm::SimplifyCFGOptions::ForwardSwitchCondToPhi
bool ForwardSwitchCondToPhi
Definition: SimplifyCFGOptions.h:25
llvm::SimplifyCFGOptions
Definition: SimplifyCFGOptions.h:23
llvm::SimplifyCFGOptions::SinkCommonInsts
bool SinkCommonInsts
Definition: SimplifyCFGOptions.h:29
llvm::SimplifyCFGOptions::needCanonicalLoops
SimplifyCFGOptions & needCanonicalLoops(bool B)
Definition: SimplifyCFGOptions.h:48