9 #ifndef LLVM_CODEGEN_SWITCHLOWERINGUTILS_H 10 #define LLVM_CODEGEN_SWITCHLOWERINGUTILS_H 20 class FunctionLoweringInfo;
21 class MachineBasicBlock;
22 class BlockFrequencyInfo;
96 : Mask(mask), BB(bb), Bits(bits), ExtraProb(Prob) {}
144 : CC(cc), CmpLHS(cmplhs), CmpMHS(cmpmiddle), CmpRHS(cmprhs),
145 TrueBB(truebb), FalseBB(falsebb), ThisBB(me), DL(dl),
146 TrueProb(trueprob), FalseProb(falseprob) {}
155 : PredInfo({
pred, nocmp}), CmpLHS(cmplhs), CmpMHS(cmpmiddle),
156 CmpRHS(cmprhs), TrueBB(truebb), FalseBB(falsebb), ThisBB(me),
157 DbgLoc(dl), TrueProb(trueprob), FalseProb(falseprob) {}
173 : Reg(R), JTI(J), MBB(M), Default(D) {}
185 : First(
std::move(F)), Last(
std::move(L)), SValue(SV), HeaderBB(H),
186 Emitted(
E), OmitRangeCheck(
false) {}
198 : Mask(M), ThisBB(T), TargetBB(Tr), ExtraProb(Prob) {}
221 : First(
std::move(F)), Range(
std::move(R)), SValue(SV), Reg(Rg),
222 RegVT(RgVT), Emitted(E), ContiguousRange(CR), Parent(P), Default(D),
223 Cases(
std::move(C)), Prob(Pr), OmitRangeCheck(
false) {}
232 unsigned First,
unsigned Last);
283 virtual void addSuccessorWithProb(
299 #endif // LLVM_CODEGEN_SWITCHLOWERINGUTILS_H
A parsed version of the target data layout string in and methods for querying it. ...
CaseClusterVector::iterator CaseClusterIt
This class represents lattice values for constants.
MachineBasicBlock * Default
std::pair< JumpTableHeader, JumpTable > JumpTableBlock
Analysis providing profile information.
std::vector< CaseBits > CaseBitsVector
JumpTable(unsigned R, unsigned J, MachineBasicBlock *M, MachineBasicBlock *D)
static CaseCluster range(const ConstantInt *Low, const ConstantInt *High, MachineBasicBlock *MBB, BranchProbability Prob)
static CaseCluster jumpTable(const ConstantInt *Low, const ConstantInt *High, unsigned JTCasesIndex, BranchProbability Prob)
This structure is used to communicate between SelectionDAGBuilder and SDISel for the code generation ...
uint64_t getJumpTableRange(const CaseClusterVector &Clusters, unsigned First, unsigned Last)
Return the range of values within a range.
BranchProbability TrueProb
BranchProbability ExtraProb
A cluster of cases suitable for jump table lowering.
void init(const TargetLowering &tli, const TargetMachine &tm, const DataLayout &dl)
std::vector< CaseCluster > CaseClusterVector
std::vector< BitTestBlock > BitTestCases
Vector of BitTestBlock structures used to communicate SwitchInst code generation information.
SDLoc DL
The debug location of the instruction this CaseBlock was produced from.
This class defines information used to lower LLVM code to legal SelectionDAG operators that the targe...
MachineBasicBlock * ThisBB
MachineBasicBlock * TrueBB
CondCode
ISD::CondCode enum - These are ordered carefully to make the bitfields below work out...
BitTestCase(uint64_t M, MachineBasicBlock *T, MachineBasicBlock *Tr, BranchProbability Prob)
unsigned JTI
The JumpTableIndex for this jump table in the function.
static CaseCluster bitTests(const ConstantInt *Low, const ConstantInt *High, unsigned BTCasesIndex, BranchProbability Prob)
BlockFrequencyInfo pass uses BlockFrequencyInfoImpl implementation to estimate IR basic block frequen...
static GCRegistry::Add< CoreCLRGC > E("coreclr", "CoreCLR-compatible GC")
MachineBasicBlock * MBB
The MBB into which to emit the code for the indirect jump.
void sortAndRangeify(CaseClusterVector &Clusters)
Sort Clusters and merge adjacent cases.
This file contains the declarations for the subclasses of Constant, which represent the different fla...
BranchProbability DefaultProb
Predicate
This enumeration lists the possible predicates for CmpInst subclasses.
std::vector< JumpTableBlock > JTCases
Vector of JumpTable structures used to communicate SwitchInst code generation information.
CaseClusterIt LastCluster
BranchProbability ExtraProb
MachineBasicBlock * Parent
std::vector< CaseBlock > SwitchCases
Vector of CaseBlock structures used to communicate SwitchInst code generation information.
MachineBasicBlock * TargetBB
static BranchProbability getUnknown()
This is the shared class of boolean and integer constants.
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())
Wrapper class for IR location info (IR ordering and DebugLoc) to be passed into SDNode creation funct...
static GCRegistry::Add< StatepointGC > D("statepoint-example", "an example strategy for statepoint")
uint64_t getJumpTableNumCases(const SmallVectorImpl< unsigned > &TotalCases, unsigned First, unsigned Last)
Return the number of cases within a range.
Class for arbitrary precision integers.
SwitchLowering(FunctionLoweringInfo &funcinfo)
unsigned Reg
The virtual register containing the index of the jump table entry to jump to.
CaseClusterIt FirstCluster
MachineBasicBlock * Default
The MBB of the default bb, which is a successor of the range check MBB.
A cluster of adjacent case labels with the same destination, or just one case.
FunctionLoweringInfo - This contains information that is global to a function that is used when lower...
BitTestBlock(APInt F, APInt R, const Value *SV, unsigned Rg, MVT RgVT, bool E, bool CR, MachineBasicBlock *P, MachineBasicBlock *D, BitTestInfo C, BranchProbability Pr)
LLVM Value Representation.
std::underlying_type< E >::type Mask()
Get a bitmask with 1s in all places up to the high-order bit of E's largest value.
Primary interface to the complete machine description for the target machine.
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())
BranchProbability DefaultProb
MachineBasicBlock * ThisBB
A cluster of cases suitable for bit test lowering.
A cluster of case labels.
CaseBits(uint64_t mask, MachineBasicBlock *bb, unsigned bits, BranchProbability Prob)
This file describes how to lower LLVM code to machine code.