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

Methods

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)

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::ConstantInt* OnVal
llvm::BasicBlock* Dest
llvm::SwitchInstProfUpdateWrapper::CaseWeightOpt W

llvm::MDNode* buildProfBranchWeightsMD()

Declared at: llvm/include/llvm/IR/Instructions.h:3593

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)

Declared at: llvm/include/llvm/IR/Instructions.h:3591

Parameters

const llvm::SwitchInst& SI

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)

Declared at: llvm/include/llvm/IR/Instructions.h:3625

Parameters

const llvm::SwitchInst& SI
unsigned int idx

void init()

Declared at: llvm/include/llvm/IR/Instructions.h:3595

llvm::SwitchInst* operator llvm::SwitchInst*()

Declared at: llvm/include/llvm/IR/Instructions.h:3601

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

SwitchInst::CaseIt I

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()

Declared at: llvm/include/llvm/IR/Instructions.h:3605