|
LLVM 24.0.0git
|
#include "llvm/Transforms/Scalar/JumpTableToSwitch.h"#include "ScalarOptions.h"#include "llvm/ADT/STLExtras.h"#include "llvm/ADT/SmallVector.h"#include "llvm/ADT/Statistic.h"#include "llvm/Analysis/ConstantFolding.h"#include "llvm/Analysis/DomTreeUpdater.h"#include "llvm/Analysis/OptimizationRemarkEmitter.h"#include "llvm/Analysis/PostDominators.h"#include "llvm/IR/IRBuilder.h"#include "llvm/IR/LLVMContext.h"#include "llvm/IR/ProfDataUtils.h"#include "llvm/ProfileData/InstrProf.h"#include "llvm/Transforms/Utils/BasicBlockUtils.h"#include <limits>Go to the source code of this file.
Macros | |
| #define | DEBUG_TYPE "jump-table-to-switch" |
Functions | |
| STATISTIC (NumEligibleJumpTables, "The number of jump tables seen by the pass " "that can be converted if deemed profitable.") | |
| STATISTIC (NumJumpTablesConverted, "The number of jump tables converted into switches.") | |
| static Function * | getExpandableCallee (const ScalarOptions &Opts, Value *V, FunctionType *CallFTy) |
| static std::optional< JumpTable > | parseJumpTable (const ScalarOptions &Opts, GetElementPtrInst *GEP, PointerType *PtrTy, FunctionType *CallFTy) |
| static BasicBlock * | expandToSwitch (CallBase *CB, const JumpTable &JT, DomTreeUpdater &DTU, OptimizationRemarkEmitter &ORE, llvm::function_ref< GlobalValue::GUID(const Function &)> GetGuidForFunction) |
| #define DEBUG_TYPE "jump-table-to-switch" |
Definition at line 27 of file JumpTableToSwitch.cpp.
|
static |
Definition at line 111 of file JumpTableToSwitch.cpp.
References llvm::all_of(), llvm::any_of(), llvm::GenericDomTreeUpdater< DerivedT, DomTreeT, PostDomTreeT >::applyUpdates(), assert(), B(), C(), Call, llvm::cast(), llvm::Instruction::clone(), llvm::BasicBlock::Create(), llvm::UncondBrInst::Create(), llvm::IRBuilderBase::CreatePHI(), llvm::IRBuilderBase::CreateUnreachable(), DEBUG_TYPE, llvm::DominatorTreeBase< BasicBlock, false >::Delete, llvm::downscaleWeights(), llvm::dyn_cast(), llvm::OptimizationRemarkEmitter::emit(), llvm::Instruction::eraseFromParent(), llvm::extractBranchWeights(), F, G, llvm::CallBase::getCalledOperand(), llvm::Value::getContext(), llvm::Instruction::getMetadata(), llvm::Value::getName(), llvm::BasicBlock::getParent(), llvm::ilist_detail::node_parent_access< NodeTy, ParentTy >::getParent(), llvm::BasicBlock::getTerminator(), llvm::Value::getType(), llvm::getValueProfDataFromInst(), llvm::Type::getVoidTy(), llvm::DominatorTreeBase< BasicBlock, false >::Insert, llvm::DenseMapBase< StorageT, KeyT, ValueT, KeyInfoT, BucketT >::insert(), llvm::isValueProfileMD(), llvm::DenseMapBase< StorageT, KeyT, ValueT, KeyInfoT, BucketT >::lookup_or(), llvm::not_equal_to(), PHI, llvm::SmallVectorTemplateBase< T, bool >::push_back(), llvm::Value::replaceAllUsesWith(), llvm::SmallVectorImpl< T >::reserve(), Select, llvm::setBranchWeights(), llvm::setExplicitlyUnknownBranchWeights(), llvm::SplitBlock(), and uint64_t.
Referenced by llvm::JumpTableToSwitchPass::run().
|
static |
Definition at line 41 of file JumpTableToSwitch.cpp.
References llvm::dyn_cast().
Referenced by parseJumpTable(), and llvm::JumpTableToSwitchPass::run().
|
static |
Definition at line 51 of file JumpTableToSwitch.cpp.
References llvm::BitWidth, C(), llvm::ConstantFoldLoadFromConst(), DL, llvm::dyn_cast(), F, llvm::MapVector< KeyT, ValueT, MapType, VectorType, N >::front(), GEP, getExpandableCallee(), llvm::GlobalVariable::getGlobalSize(), llvm::GlobalVariable::getInitializer(), llvm::APInt::getZExtValue(), llvm::GlobalVariable::hasDefinitiveInitializer(), llvm::isa(), llvm::GlobalVariable::isConstant(), llvm::APInt::isZero(), N, llvm::NullPointerIsDefined(), llvm::Offset, llvm::MapVector< KeyT, ValueT, MapType, VectorType, N >::size(), and uint64_t.
Referenced by llvm::JumpTableToSwitchPass::run().
| STATISTIC | ( | NumEligibleJumpTables | , |
| "The number of jump tables seen by the pass " "that can be converted if deemed profitable." | ) |
| STATISTIC | ( | NumJumpTablesConverted | , |
| "The number of jump tables converted into switches." | ) |