|
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/Loads.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, LoadInst *LI, PointerType *PtrTy, FunctionType *CallFTy, IRBuilderBase &Builder) |
| 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 28 of file JumpTableToSwitch.cpp.
|
static |
Definition at line 92 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 42 of file JumpTableToSwitch.cpp.
References llvm::dyn_cast(), and V.
Referenced by parseJumpTable(), and llvm::JumpTableToSwitchPass::run().
|
static |
Definition at line 52 of file JumpTableToSwitch.cpp.
References C(), llvm::SmallVectorTemplateCommon< T, typename >::empty(), F, llvm::ConstGlobalLoad::fromLoadInst(), getExpandableCallee(), llvm::ilist_detail::node_parent_access< NodeTy, ParentTy >::getParent(), llvm::isa(), N, llvm::NullPointerIsDefined(), llvm::SmallVectorTemplateBase< T, bool >::push_back(), llvm::SmallVectorImpl< T >::reserve(), 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." | ) |