|
LLVM
10.0.0
|
A wrapper class to simplify modification of SwitchInst cases along with their prof branch_weights metadata. More...
#include "llvm/IR/Instructions.h"
Public Types | |
| using | CaseWeightOpt = Optional< uint32_t > |
Public Member Functions | |
| SwitchInst * | operator-> () |
| SwitchInst & | operator* () |
| operator SwitchInst * () | |
| SwitchInstProfUpdateWrapper (SwitchInst &SI) | |
| ~SwitchInstProfUpdateWrapper () | |
| SwitchInst::CaseIt | removeCase (SwitchInst::CaseIt I) |
| Delegate the call to the underlying SwitchInst::removeCase() and remove correspondent branch weight. More... | |
| void | addCase (ConstantInt *OnVal, BasicBlock *Dest, CaseWeightOpt W) |
| Delegate the call to the underlying SwitchInst::addCase() and set the specified branch weight for the added case. More... | |
| SymbolTableList< Instruction >::iterator | eraseFromParent () |
| Delegate the call to the underlying SwitchInst::eraseFromParent() and mark this object to not touch the underlying SwitchInst in destructor. More... | |
| void | setSuccessorWeight (unsigned idx, CaseWeightOpt W) |
| CaseWeightOpt | getSuccessorWeight (unsigned idx) |
Static Public Member Functions | |
| static CaseWeightOpt | getSuccessorWeight (const SwitchInst &SI, unsigned idx) |
Protected Member Functions | |
| MDNode * | buildProfBranchWeightsMD () |
| void | init () |
Static Protected Member Functions | |
| static MDNode * | getProfBranchWeightsMD (const SwitchInst &SI) |
A wrapper class to simplify modification of SwitchInst cases along with their prof branch_weights metadata.
Definition at line 3471 of file Instructions.h.
Definition at line 3484 of file Instructions.h.
|
inline |
Definition at line 3489 of file Instructions.h.
References llvm::cl::init().
|
inline |
Definition at line 3491 of file Instructions.h.
References llvm::Instruction::eraseFromParent(), llvm::Instruction::setMetadata(), and llvm::RISCVFenceField::W.
| void SwitchInstProfUpdateWrapper::addCase | ( | ConstantInt * | OnVal, |
| BasicBlock * | Dest, | ||
| SwitchInstProfUpdateWrapper::CaseWeightOpt | W | ||
| ) |
Delegate the call to the underlying SwitchInst::addCase() and set the specified branch weight for the added case.
Definition at line 3944 of file Instructions.cpp.
References llvm::SwitchInst::addCase(), assert(), llvm::SwitchInst::getNumSuccessors(), and llvm::RISCVFenceField::W.
Referenced by SimplifyIndirectBrOnSelect().
|
protected |
Definition at line 3892 of file Instructions.cpp.
References llvm::all_of(), assert(), llvm::BasicBlock::getContext(), llvm::SwitchInst::getNumSuccessors(), llvm::Instruction::getParent(), and llvm::RISCVFenceField::W.
| SymbolTableList< Instruction >::iterator SwitchInstProfUpdateWrapper::eraseFromParent | ( | ) |
Delegate the call to the underlying SwitchInst::eraseFromParent() and mark this object to not touch the underlying SwitchInst in destructor.
Definition at line 3963 of file Instructions.cpp.
References llvm::Instruction::eraseFromParent().
Referenced by unswitchTrivialSwitch().
|
staticprotected |
Definition at line 3884 of file Instructions.cpp.
References llvm::Instruction::getMetadata().
| SwitchInstProfUpdateWrapper::CaseWeightOpt SwitchInstProfUpdateWrapper::getSuccessorWeight | ( | unsigned | idx | ) |
Definition at line 3972 of file Instructions.cpp.
References llvm::None.
Referenced by SimplifyIndirectBrOnSelect(), and unswitchTrivialSwitch().
|
static |
Definition at line 3996 of file Instructions.cpp.
References llvm::Address, llvm::User::allocHungoffUses(), assert(), llvm::numbers::e, E, llvm::Value::getContext(), llvm::User::getNumOperands(), llvm::SwitchInst::getNumSuccessors(), llvm::User::getOperandList(), llvm::Value::getType(), llvm::Type::getVoidTy(), llvm::User::growHungoffUses(), llvm::cl::init(), llvm::Instruction::Instruction(), llvm::Type::isPointerTy(), llvm::None, llvm::User::setNumHungOffUseOperands(), and llvm::Value::SubclassOptionalData.
|
protected |
|
inline |
Definition at line 3487 of file Instructions.h.
References SI.
|
inline |
Definition at line 3486 of file Instructions.h.
References SI.
|
inline |
Definition at line 3485 of file Instructions.h.
References SI.
| SwitchInst::CaseIt SwitchInstProfUpdateWrapper::removeCase | ( | SwitchInst::CaseIt | I | ) |
Delegate the call to the underlying SwitchInst::removeCase() and remove correspondent branch weight.
Definition at line 3930 of file Instructions.cpp.
References assert(), llvm::SwitchInst::getNumSuccessors(), and llvm::SwitchInst::removeCase().
Referenced by setBranchWeights(), and unswitchTrivialSwitch().
| void SwitchInstProfUpdateWrapper::setSuccessorWeight | ( | unsigned | idx, |
| SwitchInstProfUpdateWrapper::CaseWeightOpt | W | ||
| ) |
Definition at line 3978 of file Instructions.cpp.
References llvm::SwitchInst::getNumSuccessors(), and llvm::RISCVFenceField::W.
Referenced by SimplifyIndirectBrOnSelect(), and unswitchTrivialSwitch().
1.8.13