class SwitchInstProfUpdateWrapper
Declaration
class SwitchInstProfUpdateWrapper { /* full declaration omitted */ };
Description
A wrapper class to simplify modification of SwitchInst cases along with their prof branch_weights metadata.
Declared at: llvm/include/llvm/IR/Instructions.h:3585
Member Variables
- private llvm::SwitchInst& SI
- private Optional<SmallVector<uint32_t, 8>> Weights = None
- private bool Changed = false
Method Overview
- public SwitchInstProfUpdateWrapper(llvm::SwitchInst & SI)
- public void addCase(llvm::ConstantInt * OnVal, llvm::BasicBlock * Dest, llvm::SwitchInstProfUpdateWrapper::CaseWeightOpt W)
- protected llvm::MDNode * buildProfBranchWeightsMD()
- public SymbolTableList<Instruction>::iterator eraseFromParent()
- protected static llvm::MDNode * getProfBranchWeightsMD(const llvm::SwitchInst & SI)
- public llvm::SwitchInstProfUpdateWrapper::CaseWeightOpt getSuccessorWeight(unsigned int idx)
- public static llvm::SwitchInstProfUpdateWrapper::CaseWeightOpt getSuccessorWeight(const llvm::SwitchInst & SI, unsigned int idx)
- protected void init()
- public llvm::SwitchInst * operator llvm::SwitchInst *()
- public SwitchInst::CaseIt removeCase(SwitchInst::CaseIt I)
- public void setSuccessorWeight(unsigned int idx, llvm::SwitchInstProfUpdateWrapper::CaseWeightOpt W)
- public ~SwitchInstProfUpdateWrapper()
Methods
¶SwitchInstProfUpdateWrapper(llvm::SwitchInst& SI)
SwitchInstProfUpdateWrapper(llvm::SwitchInst& SI)
Declared at: llvm/include/llvm/IR/Instructions.h:3603
Parameters
- llvm::SwitchInst& SI
¶void addCase(llvm::ConstantInt* OnVal,
llvm::BasicBlock* Dest,
llvm::SwitchInstProfUpdateWrapper::
CaseWeightOpt W)
void addCase(llvm::ConstantInt* OnVal,
llvm::BasicBlock* Dest,
llvm::SwitchInstProfUpdateWrapper::
CaseWeightOpt W)
Description
Delegate the call to the underlying SwitchInst::addCase() and set the specified branch weight for the added case.
Declared at: llvm/include/llvm/IR/Instructions.h:3616
Parameters
¶llvm::MDNode* buildProfBranchWeightsMD()
llvm::MDNode* buildProfBranchWeightsMD()
Declared at: llvm/include/llvm/IR/Instructions.h:3593
¶SymbolTableList<Instruction>::iterator
eraseFromParent()
SymbolTableList<Instruction>::iterator
eraseFromParent()
Description
Delegate the call to the underlying SwitchInst::eraseFromParent() and mark this object to not touch the underlying SwitchInst in destructor.
Declared at: llvm/include/llvm/IR/Instructions.h:3620
¶static llvm::MDNode* getProfBranchWeightsMD(
const llvm::SwitchInst& SI)
static llvm::MDNode* getProfBranchWeightsMD(
const llvm::SwitchInst& SI)
Declared at: llvm/include/llvm/IR/Instructions.h:3591
Parameters
- const llvm::SwitchInst& SI
¶llvm::SwitchInstProfUpdateWrapper::CaseWeightOpt
getSuccessorWeight(unsigned int idx)
llvm::SwitchInstProfUpdateWrapper::CaseWeightOpt
getSuccessorWeight(unsigned int idx)
Declared at: llvm/include/llvm/IR/Instructions.h:3623
Parameters
- unsigned int idx
¶static llvm::SwitchInstProfUpdateWrapper::
CaseWeightOpt
getSuccessorWeight(const llvm::SwitchInst& SI,
unsigned int idx)
static llvm::SwitchInstProfUpdateWrapper::
CaseWeightOpt
getSuccessorWeight(const llvm::SwitchInst& SI,
unsigned int idx)
Declared at: llvm/include/llvm/IR/Instructions.h:3625
Parameters
- const llvm::SwitchInst& SI
- unsigned int idx
¶void init()
void init()
Declared at: llvm/include/llvm/IR/Instructions.h:3595
¶llvm::SwitchInst* operator llvm::SwitchInst*()
llvm::SwitchInst* operator llvm::SwitchInst*()
Declared at: llvm/include/llvm/IR/Instructions.h:3601
¶SwitchInst::CaseIt removeCase(
SwitchInst::CaseIt I)
SwitchInst::CaseIt removeCase(
SwitchInst::CaseIt I)
Description
Delegate the call to the underlying SwitchInst::removeCase() and remove correspondent branch weight.
Declared at: llvm/include/llvm/IR/Instructions.h:3612
Parameters
¶void setSuccessorWeight(
unsigned int idx,
llvm::SwitchInstProfUpdateWrapper::
CaseWeightOpt W)
void setSuccessorWeight(
unsigned int idx,
llvm::SwitchInstProfUpdateWrapper::
CaseWeightOpt W)
Declared at: llvm/include/llvm/IR/Instructions.h:3622
Parameters
- unsigned int idx
- llvm::SwitchInstProfUpdateWrapper::CaseWeightOpt W
¶~SwitchInstProfUpdateWrapper()
~SwitchInstProfUpdateWrapper()
Declared at: llvm/include/llvm/IR/Instructions.h:3605