LLVM  14.0.0git
SwitchLoweringUtils.h
Go to the documentation of this file.
1 //===- SwitchLoweringUtils.h - Switch Lowering ------------------*- 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 #ifndef LLVM_CODEGEN_SWITCHLOWERINGUTILS_H
10 #define LLVM_CODEGEN_SWITCHLOWERINGUTILS_H
11 
12 #include "llvm/ADT/SmallVector.h"
15 #include "llvm/IR/InstrTypes.h"
17 #include <vector>
18 
19 namespace llvm {
20 
21 class BlockFrequencyInfo;
22 class ConstantInt;
23 class FunctionLoweringInfo;
24 class MachineBasicBlock;
25 class ProfileSummaryInfo;
26 class TargetLowering;
27 class TargetMachine;
28 
29 namespace SwitchCG {
30 
32  /// A cluster of adjacent case labels with the same destination, or just one
33  /// case.
35  /// A cluster of cases suitable for jump table lowering.
37  /// A cluster of cases suitable for bit test lowering.
39 };
40 
41 /// A cluster of case labels.
42 struct CaseCluster {
44  const ConstantInt *Low, *High;
45  union {
47  unsigned JTCasesIndex;
48  unsigned BTCasesIndex;
49  };
51 
54  CaseCluster C;
55  C.Kind = CC_Range;
56  C.Low = Low;
57  C.High = High;
58  C.MBB = MBB;
59  C.Prob = Prob;
60  return C;
61  }
62 
65  CaseCluster C;
66  C.Kind = CC_JumpTable;
67  C.Low = Low;
68  C.High = High;
69  C.JTCasesIndex = JTCasesIndex;
70  C.Prob = Prob;
71  return C;
72  }
73 
76  CaseCluster C;
77  C.Kind = CC_BitTests;
78  C.Low = Low;
79  C.High = High;
80  C.BTCasesIndex = BTCasesIndex;
81  C.Prob = Prob;
82  return C;
83  }
84 };
85 
86 using CaseClusterVector = std::vector<CaseCluster>;
87 using CaseClusterIt = CaseClusterVector::iterator;
88 
89 /// Sort Clusters and merge adjacent cases.
90 void sortAndRangeify(CaseClusterVector &Clusters);
91 
92 struct CaseBits {
94  MachineBasicBlock *BB = nullptr;
95  unsigned Bits = 0;
97 
98  CaseBits() = default;
100  BranchProbability Prob)
101  : Mask(mask), BB(bb), Bits(bits), ExtraProb(Prob) {}
102 };
103 
104 using CaseBitsVector = std::vector<CaseBits>;
105 
106 /// This structure is used to communicate between SelectionDAGBuilder and
107 /// SDISel for the code generation of additional basic blocks needed by
108 /// multi-case switch statements.
109 struct CaseBlock {
110  // For the GISel interface.
111  struct PredInfoPair {
113  // Set when no comparison should be emitted.
114  bool NoCmp;
115  };
116  union {
117  // The condition code to use for the case block's setcc node.
118  // Besides the integer condition codes, this can also be SETTRUE, in which
119  // case no comparison gets emitted.
122  };
123 
124  // The LHS/MHS/RHS of the comparison to emit.
125  // Emit by default LHS op RHS. MHS is used for range comparisons:
126  // If MHS is not null: (LHS <= MHS) and (MHS <= RHS).
127  const Value *CmpLHS, *CmpMHS, *CmpRHS;
128 
129  // The block to branch to if the setcc is true/false.
131 
132  // The block into which to emit the code for the setcc and branches.
134 
135  /// The debug location of the instruction this CaseBlock was
136  /// produced from.
139 
140  // Branch weights.
142 
143  // Constructor for SelectionDAG.
144  CaseBlock(ISD::CondCode cc, const Value *cmplhs, const Value *cmprhs,
145  const Value *cmpmiddle, MachineBasicBlock *truebb,
146  MachineBasicBlock *falsebb, MachineBasicBlock *me, SDLoc dl,
149  : CC(cc), CmpLHS(cmplhs), CmpMHS(cmpmiddle), CmpRHS(cmprhs),
150  TrueBB(truebb), FalseBB(falsebb), ThisBB(me), DL(dl),
151  TrueProb(trueprob), FalseProb(falseprob) {}
152 
153  // Constructor for GISel.
154  CaseBlock(CmpInst::Predicate pred, bool nocmp, const Value *cmplhs,
155  const Value *cmprhs, const Value *cmpmiddle,
156  MachineBasicBlock *truebb, MachineBasicBlock *falsebb,
157  MachineBasicBlock *me, DebugLoc dl,
160  : PredInfo({pred, nocmp}), CmpLHS(cmplhs), CmpMHS(cmpmiddle),
161  CmpRHS(cmprhs), TrueBB(truebb), FalseBB(falsebb), ThisBB(me),
162  DbgLoc(dl), TrueProb(trueprob), FalseProb(falseprob) {}
163 };
164 
165 struct JumpTable {
166  /// The virtual register containing the index of the jump table entry
167  /// to jump to.
168  unsigned Reg;
169  /// The JumpTableIndex for this jump table in the function.
170  unsigned JTI;
171  /// The MBB into which to emit the code for the indirect jump.
173  /// The MBB of the default bb, which is a successor of the range
174  /// check MBB. This is when updating PHI nodes in successors.
176 
177  JumpTable(unsigned R, unsigned J, MachineBasicBlock *M, MachineBasicBlock *D)
178  : Reg(R), JTI(J), MBB(M), Default(D) {}
179 };
183  const Value *SValue;
185  bool Emitted;
187 
189  bool E = false)
190  : First(std::move(F)), Last(std::move(L)), SValue(SV), HeaderBB(H),
192 };
193 using JumpTableBlock = std::pair<JumpTableHeader, JumpTable>;
194 
195 struct BitTestCase {
200 
202  BranchProbability Prob)
203  : Mask(M), ThisBB(T), TargetBB(Tr), ExtraProb(Prob) {}
204 };
205 
207 
208 struct BitTestBlock {
211  const Value *SValue;
212  unsigned Reg;
214  bool Emitted;
222 
223  BitTestBlock(APInt F, APInt R, const Value *SV, unsigned Rg, MVT RgVT, bool E,
226  : First(std::move(F)), Range(std::move(R)), SValue(SV), Reg(Rg),
227  RegVT(RgVT), Emitted(E), ContiguousRange(CR), Parent(P), Default(D),
229 };
230 
231 /// Return the range of values within a range.
232 uint64_t getJumpTableRange(const CaseClusterVector &Clusters, unsigned First,
233  unsigned Last);
234 
235 /// Return the number of cases within a range.
237  unsigned First, unsigned Last);
238 
243  const ConstantInt *GE;
244  const ConstantInt *LT;
246 };
248 
250 public:
251  SwitchLowering(FunctionLoweringInfo &funcinfo) : FuncInfo(funcinfo) {}
252 
253  void init(const TargetLowering &tli, const TargetMachine &tm,
254  const DataLayout &dl) {
255  TLI = &tli;
256  TM = &tm;
257  DL = &dl;
258  }
259 
260  /// Vector of CaseBlock structures used to communicate SwitchInst code
261  /// generation information.
262  std::vector<CaseBlock> SwitchCases;
263 
264  /// Vector of JumpTable structures used to communicate SwitchInst code
265  /// generation information.
266  std::vector<JumpTableBlock> JTCases;
267 
268  /// Vector of BitTestBlock structures used to communicate SwitchInst code
269  /// generation information.
270  std::vector<BitTestBlock> BitTestCases;
271 
272  void findJumpTables(CaseClusterVector &Clusters, const SwitchInst *SI,
273  MachineBasicBlock *DefaultMBB,
275 
276  bool buildJumpTable(const CaseClusterVector &Clusters, unsigned First,
277  unsigned Last, const SwitchInst *SI,
278  MachineBasicBlock *DefaultMBB, CaseCluster &JTCluster);
279 
280 
281  void findBitTestClusters(CaseClusterVector &Clusters, const SwitchInst *SI);
282 
283  /// Build a bit test cluster from Clusters[First..Last]. Returns false if it
284  /// decides it's not a good idea.
285  bool buildBitTests(CaseClusterVector &Clusters, unsigned First, unsigned Last,
286  const SwitchInst *SI, CaseCluster &BTCluster);
287 
288  virtual void addSuccessorWithProb(
291 
292  virtual ~SwitchLowering() = default;
293 
294 private:
295  const TargetLowering *TLI;
296  const TargetMachine *TM;
297  const DataLayout *DL;
298  FunctionLoweringInfo &FuncInfo;
299 };
300 
301 } // namespace SwitchCG
302 } // namespace llvm
303 
304 #endif // LLVM_CODEGEN_SWITCHLOWERINGUTILS_H
llvm::SwitchCG::JumpTable::JumpTable
JumpTable(unsigned R, unsigned J, MachineBasicBlock *M, MachineBasicBlock *D)
Definition: SwitchLoweringUtils.h:177
llvm::SwitchCG::sortAndRangeify
void sortAndRangeify(CaseClusterVector &Clusters)
Sort Clusters and merge adjacent cases.
Definition: SwitchLoweringUtils.cpp:464
llvm
This file implements support for optimizing divisions by a constant.
Definition: AllocatorList.h:23
M
We currently emits eax Perhaps this is what we really should generate is Is imull three or four cycles eax eax The current instruction priority is based on pattern complexity The former is more complex because it folds a load so the latter will not be emitted Perhaps we should use AddedComplexity to give LEA32r a higher priority We should always try to match LEA first since the LEA matching code does some estimate to determine whether the match is profitable if we care more about code then imull is better It s two bytes shorter than movl leal On a Pentium M
Definition: README.txt:252
llvm::SDLoc
Wrapper class for IR location info (IR ordering and DebugLoc) to be passed into SDNode creation funct...
Definition: SelectionDAGNodes.h:1086
llvm::DataLayout
A parsed version of the target data layout string in and methods for querying it.
Definition: DataLayout.h:113
llvm::CmpInst::Predicate
Predicate
This enumeration lists the possible predicates for CmpInst subclasses.
Definition: InstrTypes.h:720
llvm::SwitchCG::CaseBits
Definition: SwitchLoweringUtils.h:92
llvm::SwitchCG::JumpTable::MBB
MachineBasicBlock * MBB
The MBB into which to emit the code for the indirect jump.
Definition: SwitchLoweringUtils.h:172
llvm::SwitchCG::SwitchLowering::SwitchLowering
SwitchLowering(FunctionLoweringInfo &funcinfo)
Definition: SwitchLoweringUtils.h:251
llvm::SwitchCG::CaseBlock
This structure is used to communicate between SelectionDAGBuilder and SDISel for the code generation ...
Definition: SwitchLoweringUtils.h:109
llvm::SwitchCG::CaseBlock::DbgLoc
DebugLoc DbgLoc
Definition: SwitchLoweringUtils.h:138
P
This currently compiles esp xmm0 movsd esp eax eax esp ret We should use not the dag combiner This is because dagcombine2 needs to be able to see through the X86ISD::Wrapper which DAGCombine can t really do The code for turning x load into a single vector load is target independent and should be moved to the dag combiner The code for turning x load into a vector load can only handle a direct load from a global or a direct load from the stack It should be generalized to handle any load from P
Definition: README-SSE.txt:411
llvm::SwitchCG::CaseCluster::MBB
MachineBasicBlock * MBB
Definition: SwitchLoweringUtils.h:46
llvm::SwitchCG::JumpTableHeader::JumpTableHeader
JumpTableHeader(APInt F, APInt L, const Value *SV, MachineBasicBlock *H, bool E=false)
Definition: SwitchLoweringUtils.h:188
llvm::SwitchCG::SwitchLowering
Definition: SwitchLoweringUtils.h:249
llvm::SwitchCG::BitTestCase::Mask
uint64_t Mask
Definition: SwitchLoweringUtils.h:196
cc
src override malloc cc
Definition: CMakeLists.txt:93
llvm::SmallVector< BitTestCase, 3 >
llvm::SwitchCG::JumpTableHeader::FallthroughUnreachable
bool FallthroughUnreachable
Definition: SwitchLoweringUtils.h:186
llvm::SwitchCG::JumpTableHeader::HeaderBB
MachineBasicBlock * HeaderBB
Definition: SwitchLoweringUtils.h:184
llvm::SwitchCG::CC_JumpTable
@ CC_JumpTable
A cluster of cases suitable for jump table lowering.
Definition: SwitchLoweringUtils.h:36
llvm::SwitchCG::SwitchWorkListItem
Definition: SwitchLoweringUtils.h:239
llvm::SwitchCG::SwitchLowering::init
void init(const TargetLowering &tli, const TargetMachine &tm, const DataLayout &dl)
Definition: SwitchLoweringUtils.h:253
llvm::SwitchCG::CaseClusterIt
CaseClusterVector::iterator CaseClusterIt
Definition: SwitchLoweringUtils.h:87
llvm::SwitchCG::getJumpTableNumCases
uint64_t getJumpTableNumCases(const SmallVectorImpl< unsigned > &TotalCases, unsigned First, unsigned Last)
Return the number of cases within a range.
Definition: SwitchLoweringUtils.cpp:37
T
#define T
Definition: Mips16ISelLowering.cpp:341
llvm::SwitchCG::BitTestBlock::FallthroughUnreachable
bool FallthroughUnreachable
Definition: SwitchLoweringUtils.h:221
llvm::SwitchCG::JumpTableHeader::Last
APInt Last
Definition: SwitchLoweringUtils.h:182
llvm::SwitchCG::SwitchLowering::buildJumpTable
bool buildJumpTable(const CaseClusterVector &Clusters, unsigned First, unsigned Last, const SwitchInst *SI, MachineBasicBlock *DefaultMBB, CaseCluster &JTCluster)
Definition: SwitchLoweringUtils.cpp:190
llvm::SwitchCG::CaseBlock::CmpMHS
const Value * CmpMHS
Definition: SwitchLoweringUtils.h:127
F
#define F(x, y, z)
Definition: MD5.cpp:56
llvm::SwitchCG::BitTestBlock::Default
MachineBasicBlock * Default
Definition: SwitchLoweringUtils.h:217
llvm::SwitchCG::BitTestCase::ThisBB
MachineBasicBlock * ThisBB
Definition: SwitchLoweringUtils.h:197
llvm::SwitchCG::SwitchWorkListItem::DefaultProb
BranchProbability DefaultProb
Definition: SwitchLoweringUtils.h:245
llvm::SwitchCG::CaseBits::Mask
uint64_t Mask
Definition: SwitchLoweringUtils.h:93
llvm::SwitchCG::CaseClusterKind
CaseClusterKind
Definition: SwitchLoweringUtils.h:31
llvm::SwitchCG::BitTestBlock::First
APInt First
Definition: SwitchLoweringUtils.h:209
llvm::ConstantInt
This is the shared class of boolean and integer constants.
Definition: Constants.h:79
bb
< i1 > br i1 label label bb bb
Definition: README.txt:978
llvm::BlockFrequencyInfo
BlockFrequencyInfo pass uses BlockFrequencyInfoImpl implementation to estimate IR basic block frequen...
Definition: BlockFrequencyInfo.h:37
llvm::SwitchCG::CaseBlock::FalseBB
MachineBasicBlock * FalseBB
Definition: SwitchLoweringUtils.h:130
SelectionDAGNodes.h
bits
demanded bits
Definition: DemandedBits.cpp:63
llvm::SwitchCG::BitTestBlock::SValue
const Value * SValue
Definition: SwitchLoweringUtils.h:211
llvm::SwitchCG::SwitchLowering::~SwitchLowering
virtual ~SwitchLowering()=default
llvm::SwitchCG::BitTestBlock::BitTestBlock
BitTestBlock(APInt F, APInt R, const Value *SV, unsigned Rg, MVT RgVT, bool E, bool CR, MachineBasicBlock *P, MachineBasicBlock *D, BitTestInfo C, BranchProbability Pr)
Definition: SwitchLoweringUtils.h:223
llvm::SwitchCG::SwitchLowering::BitTestCases
std::vector< BitTestBlock > BitTestCases
Vector of BitTestBlock structures used to communicate SwitchInst code generation information.
Definition: SwitchLoweringUtils.h:270
E
static GCRegistry::Add< CoreCLRGC > E("coreclr", "CoreCLR-compatible GC")
C
(vector float) vec_cmpeq(*A, *B) C
Definition: README_ALTIVEC.txt:86
InstrTypes.h
llvm::TargetLowering
This class defines information used to lower LLVM code to legal SelectionDAG operators that the targe...
Definition: TargetLowering.h:3195
llvm::SwitchCG::SwitchWorkListItem::LT
const ConstantInt * LT
Definition: SwitchLoweringUtils.h:244
llvm::SwitchCG::CaseBitsVector
std::vector< CaseBits > CaseBitsVector
Definition: SwitchLoweringUtils.h:104
llvm::SwitchCG::CaseCluster::Kind
CaseClusterKind Kind
Definition: SwitchLoweringUtils.h:43
false
Definition: StackSlotColoring.cpp:142
llvm::SwitchCG::CaseBlock::CaseBlock
CaseBlock(ISD::CondCode cc, const Value *cmplhs, const Value *cmprhs, const Value *cmpmiddle, MachineBasicBlock *truebb, MachineBasicBlock *falsebb, MachineBasicBlock *me, SDLoc dl, BranchProbability trueprob=BranchProbability::getUnknown(), BranchProbability falseprob=BranchProbability::getUnknown())
Definition: SwitchLoweringUtils.h:144
llvm::SwitchCG::CaseBlock::PredInfoPair::NoCmp
bool NoCmp
Definition: SwitchLoweringUtils.h:114
llvm::SwitchCG::getJumpTableRange
uint64_t getJumpTableRange(const CaseClusterVector &Clusters, unsigned First, unsigned Last)
Return the range of values within a range.
Definition: SwitchLoweringUtils.cpp:23
llvm::SwitchCG::BitTestBlock::DefaultProb
BranchProbability DefaultProb
Definition: SwitchLoweringUtils.h:220
llvm::SwitchCG::CaseBlock::FalseProb
BranchProbability FalseProb
Definition: SwitchLoweringUtils.h:141
llvm::SwitchCG::CaseCluster::High
const ConstantInt * High
Definition: SwitchLoweringUtils.h:44
llvm::BranchProbability::getUnknown
static BranchProbability getUnknown()
Definition: BranchProbability.h:51
BranchProbability.h
llvm::SwitchCG::JumpTableHeader::First
APInt First
Definition: SwitchLoweringUtils.h:181
llvm::MachineBasicBlock
Definition: MachineBasicBlock.h:95
llvm::SwitchCG::JumpTableBlock
std::pair< JumpTableHeader, JumpTable > JumpTableBlock
Definition: SwitchLoweringUtils.h:193
llvm::ProfileSummaryInfo
Analysis providing profile information.
Definition: ProfileSummaryInfo.h:39
llvm::SwitchCG::CaseBlock::DL
SDLoc DL
The debug location of the instruction this CaseBlock was produced from.
Definition: SwitchLoweringUtils.h:137
llvm::SwitchCG::CaseBits::Bits
unsigned Bits
Definition: SwitchLoweringUtils.h:95
llvm::SwitchCG::CaseBits::ExtraProb
BranchProbability ExtraProb
Definition: SwitchLoweringUtils.h:96
llvm::SwitchCG::SwitchLowering::buildBitTests
bool buildBitTests(CaseClusterVector &Clusters, unsigned First, unsigned Last, const SwitchInst *SI, CaseCluster &BTCluster)
Build a bit test cluster from Clusters[First..Last].
Definition: SwitchLoweringUtils.cpp:364
llvm::SwitchCG::SwitchLowering::JTCases
std::vector< JumpTableBlock > JTCases
Vector of JumpTable structures used to communicate SwitchInst code generation information.
Definition: SwitchLoweringUtils.h:266
llvm::SwitchCG::BitTestBlock::Parent
MachineBasicBlock * Parent
Definition: SwitchLoweringUtils.h:216
uint64_t
D
static GCRegistry::Add< StatepointGC > D("statepoint-example", "an example strategy for statepoint")
llvm::SwitchCG::CaseBlock::PredInfo
struct PredInfoPair PredInfo
Definition: SwitchLoweringUtils.h:121
llvm::SwitchCG::CaseBlock::TrueProb
BranchProbability TrueProb
Definition: SwitchLoweringUtils.h:141
llvm::SwitchCG::CaseCluster::jumpTable
static CaseCluster jumpTable(const ConstantInt *Low, const ConstantInt *High, unsigned JTCasesIndex, BranchProbability Prob)
Definition: SwitchLoweringUtils.h:63
llvm::SwitchCG::CaseBlock::CaseBlock
CaseBlock(CmpInst::Predicate pred, bool nocmp, const Value *cmplhs, const Value *cmprhs, const Value *cmpmiddle, MachineBasicBlock *truebb, MachineBasicBlock *falsebb, MachineBasicBlock *me, DebugLoc dl, BranchProbability trueprob=BranchProbability::getUnknown(), BranchProbability falseprob=BranchProbability::getUnknown())
Definition: SwitchLoweringUtils.h:154
llvm::SwitchCG::JumpTable::Reg
unsigned Reg
The virtual register containing the index of the jump table entry to jump to.
Definition: SwitchLoweringUtils.h:168
llvm::SwitchCG::CaseBlock::CmpRHS
const Value * CmpRHS
Definition: SwitchLoweringUtils.h:127
llvm::SwitchCG::CaseCluster::Prob
BranchProbability Prob
Definition: SwitchLoweringUtils.h:50
llvm::SwitchCG::CaseBlock::ThisBB
MachineBasicBlock * ThisBB
Definition: SwitchLoweringUtils.h:133
llvm::TargetMachine
Primary interface to the complete machine description for the target machine.
Definition: TargetMachine.h:79
llvm::move
OutputIt move(R &&Range, OutputIt Out)
Provide wrappers to std::move which take ranges instead of having to pass begin/end explicitly.
Definition: STLExtras.h:1609
llvm::FunctionLoweringInfo
FunctionLoweringInfo - This contains information that is global to a function that is used when lower...
Definition: FunctionLoweringInfo.h:52
SI
StandardInstrumentations SI(Debug, VerifyEach)
llvm::SwitchCG::BitTestBlock::Range
APInt Range
Definition: SwitchLoweringUtils.h:210
llvm::SwitchCG::CaseBits::BB
MachineBasicBlock * BB
Definition: SwitchLoweringUtils.h:94
llvm::ISD::CondCode
CondCode
ISD::CondCode enum - These are ordered carefully to make the bitfields below work out,...
Definition: ISDOpcodes.h:1361
llvm::SwitchCG::CaseBlock::CC
ISD::CondCode CC
Definition: SwitchLoweringUtils.h:120
llvm::SwitchCG::SwitchLowering::SwitchCases
std::vector< CaseBlock > SwitchCases
Vector of CaseBlock structures used to communicate SwitchInst code generation information.
Definition: SwitchLoweringUtils.h:262
llvm::SwitchCG::JumpTableHeader
Definition: SwitchLoweringUtils.h:180
llvm::MVT
Machine Value Type.
Definition: MachineValueType.h:31
llvm::SwitchCG::SwitchWorkListItem::GE
const ConstantInt * GE
Definition: SwitchLoweringUtils.h:243
llvm::SwitchCG::CC_Range
@ CC_Range
A cluster of adjacent case labels with the same destination, or just one case.
Definition: SwitchLoweringUtils.h:34
llvm::SwitchCG::BitTestBlock::ContiguousRange
bool ContiguousRange
Definition: SwitchLoweringUtils.h:215
llvm::SwitchCG::CaseBits::CaseBits
CaseBits()=default
llvm::APInt
Class for arbitrary precision integers.
Definition: APInt.h:75
llvm::SwitchCG::SwitchWorkListItem::MBB
MachineBasicBlock * MBB
Definition: SwitchLoweringUtils.h:240
llvm::SwitchCG::BitTestCase::BitTestCase
BitTestCase(uint64_t M, MachineBasicBlock *T, MachineBasicBlock *Tr, BranchProbability Prob)
Definition: SwitchLoweringUtils.h:201
llvm::SwitchCG::BitTestBlock::Reg
unsigned Reg
Definition: SwitchLoweringUtils.h:212
llvm::SwitchCG::CaseClusterVector
std::vector< CaseCluster > CaseClusterVector
Definition: SwitchLoweringUtils.h:86
llvm::SwitchCG::CaseBlock::PredInfoPair
Definition: SwitchLoweringUtils.h:111
llvm::BranchProbability
Definition: BranchProbability.h:30
DL
MachineBasicBlock MachineBasicBlock::iterator DebugLoc DL
Definition: AArch64SLSHardening.cpp:76
llvm::SwitchCG::BitTestBlock::Cases
BitTestInfo Cases
Definition: SwitchLoweringUtils.h:218
llvm::SwitchCG::BitTestCase
Definition: SwitchLoweringUtils.h:195
llvm::AMDGPUISD::BFI
@ BFI
Definition: AMDGPUISelLowering.h:421
llvm::SwitchCG::BitTestBlock
Definition: SwitchLoweringUtils.h:208
llvm::SwitchCG::SwitchLowering::findJumpTables
void findJumpTables(CaseClusterVector &Clusters, const SwitchInst *SI, MachineBasicBlock *DefaultMBB, ProfileSummaryInfo *PSI, BlockFrequencyInfo *BFI)
Definition: SwitchLoweringUtils.cpp:46
llvm::SwitchCG::JumpTable
Definition: SwitchLoweringUtils.h:165
llvm::SwitchCG::BitTestBlock::Emitted
bool Emitted
Definition: SwitchLoweringUtils.h:214
llvm::SwitchCG::BitTestBlock::Prob
BranchProbability Prob
Definition: SwitchLoweringUtils.h:219
std
Definition: BitVector.h:838
llvm::SwitchCG::SwitchLowering::findBitTestClusters
void findBitTestClusters(CaseClusterVector &Clusters, const SwitchInst *SI)
Definition: SwitchLoweringUtils.cpp:265
H
#define H(x, y, z)
Definition: MD5.cpp:58
llvm::SwitchCG::CaseCluster::BTCasesIndex
unsigned BTCasesIndex
Definition: SwitchLoweringUtils.h:48
ISDOpcodes.h
llvm::SwitchCG::SwitchWorkListItem::LastCluster
CaseClusterIt LastCluster
Definition: SwitchLoweringUtils.h:242
llvm::SwitchCG::CaseBlock::CmpLHS
const Value * CmpLHS
Definition: SwitchLoweringUtils.h:127
llvm::SwitchCG::CaseBlock::PredInfoPair::Pred
CmpInst::Predicate Pred
Definition: SwitchLoweringUtils.h:112
llvm::SwitchCG::CaseBits::CaseBits
CaseBits(uint64_t mask, MachineBasicBlock *bb, unsigned bits, BranchProbability Prob)
Definition: SwitchLoweringUtils.h:99
SmallVector.h
llvm::SwitchCG::JumpTableHeader::SValue
const Value * SValue
Definition: SwitchLoweringUtils.h:183
llvm::SwitchCG::CaseBlock::TrueBB
MachineBasicBlock * TrueBB
Definition: SwitchLoweringUtils.h:130
llvm::SwitchCG::JumpTable::JTI
unsigned JTI
The JumpTableIndex for this jump table in the function.
Definition: SwitchLoweringUtils.h:170
llvm::SwitchCG::CaseCluster::bitTests
static CaseCluster bitTests(const ConstantInt *Low, const ConstantInt *High, unsigned BTCasesIndex, BranchProbability Prob)
Definition: SwitchLoweringUtils.h:74
llvm::SwitchCG::CaseCluster::Low
const ConstantInt * Low
Definition: SwitchLoweringUtils.h:44
llvm::SmallVectorImpl< unsigned >
llvm::SwitchCG::CC_BitTests
@ CC_BitTests
A cluster of cases suitable for bit test lowering.
Definition: SwitchLoweringUtils.h:38
pred
hexagon gen pred
Definition: HexagonGenPredicate.cpp:134
llvm::SwitchCG::CaseCluster::JTCasesIndex
unsigned JTCasesIndex
Definition: SwitchLoweringUtils.h:47
llvm::SwitchInst
Multiway switch.
Definition: Instructions.h:3212
llvm::DebugLoc
A debug info location.
Definition: DebugLoc.h:33
llvm::SwitchCG::BitTestCase::TargetBB
MachineBasicBlock * TargetBB
Definition: SwitchLoweringUtils.h:198
llvm::SwitchCG::CaseCluster::range
static CaseCluster range(const ConstantInt *Low, const ConstantInt *High, MachineBasicBlock *MBB, BranchProbability Prob)
Definition: SwitchLoweringUtils.h:52
llvm::SwitchCG::JumpTableHeader::Emitted
bool Emitted
Definition: SwitchLoweringUtils.h:185
llvm::SwitchCG::JumpTable::Default
MachineBasicBlock * Default
The MBB of the default bb, which is a successor of the range check MBB.
Definition: SwitchLoweringUtils.h:175
llvm::Value
LLVM Value Representation.
Definition: Value.h:74
llvm::SwitchCG::SwitchLowering::addSuccessorWithProb
virtual void addSuccessorWithProb(MachineBasicBlock *Src, MachineBasicBlock *Dst, BranchProbability Prob=BranchProbability::getUnknown())=0
llvm::SwitchCG::SwitchWorkListItem::FirstCluster
CaseClusterIt FirstCluster
Definition: SwitchLoweringUtils.h:241
llvm::SwitchCG::BitTestBlock::RegVT
MVT RegVT
Definition: SwitchLoweringUtils.h:213
llvm::SwitchCG::BitTestCase::ExtraProb
BranchProbability ExtraProb
Definition: SwitchLoweringUtils.h:199
llvm::SwitchCG::CaseCluster
A cluster of case labels.
Definition: SwitchLoweringUtils.h:42