|
LLVM
10.0.0
|
#include "llvm/CodeGen/SwitchLoweringUtils.h"
Public Member Functions | |
| SwitchLowering (FunctionLoweringInfo &funcinfo) | |
| void | init (const TargetLowering &tli, const TargetMachine &tm, const DataLayout &dl) |
| void | findJumpTables (CaseClusterVector &Clusters, const SwitchInst *SI, MachineBasicBlock *DefaultMBB, ProfileSummaryInfo *PSI, BlockFrequencyInfo *BFI) |
| bool | buildJumpTable (const CaseClusterVector &Clusters, unsigned First, unsigned Last, const SwitchInst *SI, MachineBasicBlock *DefaultMBB, CaseCluster &JTCluster) |
| void | findBitTestClusters (CaseClusterVector &Clusters, const SwitchInst *SI) |
| bool | buildBitTests (CaseClusterVector &Clusters, unsigned First, unsigned Last, const SwitchInst *SI, CaseCluster &BTCluster) |
| Build a bit test cluster from Clusters[First..Last]. More... | |
| virtual void | addSuccessorWithProb (MachineBasicBlock *Src, MachineBasicBlock *Dst, BranchProbability Prob=BranchProbability::getUnknown())=0 |
| virtual | ~SwitchLowering ()=default |
Public Attributes | |
| std::vector< CaseBlock > | SwitchCases |
| Vector of CaseBlock structures used to communicate SwitchInst code generation information. More... | |
| std::vector< JumpTableBlock > | JTCases |
| Vector of JumpTable structures used to communicate SwitchInst code generation information. More... | |
| std::vector< BitTestBlock > | BitTestCases |
| Vector of BitTestBlock structures used to communicate SwitchInst code generation information. More... | |
Definition at line 244 of file SwitchLoweringUtils.h.
|
inline |
Definition at line 246 of file SwitchLoweringUtils.h.
|
virtualdefault |
|
pure virtual |
Implemented in llvm::SelectionDAGBuilder::SDAGSwitchLowering.
| bool SwitchCG::SwitchLowering::buildBitTests | ( | CaseClusterVector & | Clusters, |
| unsigned | First, | ||
| unsigned | Last, | ||
| const SwitchInst * | SI, | ||
| CaseCluster & | BTCluster | ||
| ) |
Build a bit test cluster from Clusters[First..Last].
Returns false if it decides it's not a good idea.
Definition at line 361 of file SwitchLoweringUtils.cpp.
References assert(), llvm::SwitchCG::CaseBits::Bits, llvm::SwitchCG::CaseCluster::bitTests(), llvm::SwitchCG::CC_Range, llvm::SwitchCG::CaseBits::ExtraProb, llvm::APInt::getBitWidth(), llvm::SwitchInst::getCondition(), llvm::APInt::getNullValue(), llvm::Instruction::getParent(), llvm::BranchProbability::getZero(), llvm::MipsISD::Hi, High, I, if(), llvm::APInt::isStrictlyPositive(), llvm::MipsISD::Lo, llvm::SwitchCG::CaseBits::Mask, llvm::MVT::Other, llvm::SmallVectorTemplateBase< T, bool >::push_back(), llvm::APInt::slt(), and llvm::sort().
| bool SwitchCG::SwitchLowering::buildJumpTable | ( | const CaseClusterVector & | Clusters, |
| unsigned | First, | ||
| unsigned | Last, | ||
| const SwitchInst * | SI, | ||
| MachineBasicBlock * | DefaultMBB, | ||
| CaseCluster & | JTCluster | ||
| ) |
Definition at line 187 of file SwitchLoweringUtils.cpp.
References assert(), llvm::SwitchCG::CC_Range, llvm::SmallPtrSetImpl< PtrType >::count(), llvm::MachineFunction::CreateMachineBasicBlock(), llvm::SwitchInst::getCondition(), llvm::MachineFunction::getOrCreateJumpTableInfo(), llvm::Instruction::getParent(), llvm::BranchProbability::getZero(), High, I, llvm::SmallPtrSetImpl< PtrType >::insert(), llvm::HexagonISD::JT, llvm::SwitchCG::CaseCluster::jumpTable(), llvm::MachineBasicBlock::normalizeSuccProbs(), llvm::DenseMapBase< DenseMap< KeyT, ValueT, KeyInfoT, BucketT >, KeyT, ValueT, KeyInfoT, BucketT >::size(), and llvm::APInt::slt().
| void SwitchCG::SwitchLowering::findBitTestClusters | ( | CaseClusterVector & | Clusters, |
| const SwitchInst * | SI | ||
| ) |
Definition at line 262 of file SwitchLoweringUtils.cpp.
References assert(), C, llvm::SwitchCG::CC_JumpTable, llvm::SwitchCG::CC_Range, llvm::EVT::getSizeInBits(), High, N, llvm::CodeGenOpt::None, llvm::ISD::SHL, and llvm::SystemZISD::TM.
| void SwitchCG::SwitchLowering::findJumpTables | ( | CaseClusterVector & | Clusters, |
| const SwitchInst * | SI, | ||
| MachineBasicBlock * | DefaultMBB, | ||
| ProfileSummaryInfo * | PSI, | ||
| BlockFrequencyInfo * | BFI | ||
| ) |
Definition at line 43 of file SwitchLoweringUtils.cpp.
References assert(), C, llvm::SwitchCG::CC_Range, llvm::numbers::e, llvm::SwitchCG::getJumpTableNumCases(), llvm::SwitchCG::getJumpTableRange(), llvm::Instruction::getParent(), llvm::BasicBlock::getParent(), llvm::MipsISD::Hi, High, I, llvm::MipsISD::Lo, N, llvm::CodeGenOpt::None, llvm::SystemZISD::TM, and UINT64_MAX.
|
inline |
Definition at line 248 of file SwitchLoweringUtils.h.
References llvm::SystemZISD::TM.
| std::vector<BitTestBlock> llvm::SwitchCG::SwitchLowering::BitTestCases |
Vector of BitTestBlock structures used to communicate SwitchInst code generation information.
Definition at line 265 of file SwitchLoweringUtils.h.
| std::vector<JumpTableBlock> llvm::SwitchCG::SwitchLowering::JTCases |
Vector of JumpTable structures used to communicate SwitchInst code generation information.
Definition at line 261 of file SwitchLoweringUtils.h.
| std::vector<CaseBlock> llvm::SwitchCG::SwitchLowering::SwitchCases |
Vector of CaseBlock structures used to communicate SwitchInst code generation information.
Definition at line 257 of file SwitchLoweringUtils.h.
1.8.13