class RegBankSelect::MappingCost

Declaration

class RegBankSelect::MappingCost { /* full declaration omitted */ };

Description

Helper class used to represent the cost for mapping an instruction. When mapping an instruction, we may introduce some repairing code. In most cases, the repairing code is local to the instruction, thus, we can omit the basic block frequency from the cost. However, some alternatives may produce non-local cost, e.g., when repairing a phi, and thus we then need to scale the local cost to the non-local cost. This class does this for us.

Declared at: llvm/include/llvm/CodeGen/GlobalISel/RegBankSelect.h:421

Method Overview

Methods

static llvm::RegBankSelect::MappingCost
ImpossibleCost()

Description

Return an instance of MappingCost that represents an impossible mapping.

Declared at: llvm/include/llvm/CodeGen/GlobalISel/RegBankSelect.h:458

MappingCost(const llvm::BlockFrequency& LocalFreq)

Description

Create a MappingCost assuming that most of the instructions will occur in a basic block with \p LocalFreq frequency.

Declared at: llvm/include/llvm/CodeGen/GlobalISel/RegBankSelect.h:442

Parameters

const llvm::BlockFrequency& LocalFreq

bool addLocalCost(uint64_t Cost)

Description

Add \p Cost to the local cost.

Declared at: llvm/include/llvm/CodeGen/GlobalISel/RegBankSelect.h:446

Parameters

uint64_t Cost

Returns

true if this cost is saturated, false otherwise.

bool addNonLocalCost(uint64_t Cost)

Description

Add \p Cost to the non-local cost. Non-local cost should reflect the frequency of their placement.

Declared at: llvm/include/llvm/CodeGen/GlobalISel/RegBankSelect.h:451

Parameters

uint64_t Cost

Returns

true if this cost is saturated, false otherwise.

void dump() const

Description

Print this on dbgs() stream.

Declared at: llvm/include/llvm/CodeGen/GlobalISel/RegBankSelect.h:472

void print(llvm::raw_ostream& OS) const

Description

Print this on \p OS;

Declared at: llvm/include/llvm/CodeGen/GlobalISel/RegBankSelect.h:475

Parameters

llvm::raw_ostream& OS

void saturate()

Description

Saturate the cost to the maximal representable value.

Declared at: llvm/include/llvm/CodeGen/GlobalISel/RegBankSelect.h:454