#include "llvm/Support/InstructionCost.h"
Definition at line 26 of file InstructionCost.h.
◆ CostType
◆ CostState
These states can currently be used to indicate whether a cost is valid or invalid.
Examples of an invalid cost might be where the cost is prohibitively expensive and the user wants to prevent certain optimizations being performed. Or perhaps the cost is simply unknown because the operation makes no sense in certain circumstances. These states can be expanded in future to support other cases if necessary.
Definition at line 36 of file InstructionCost.h.
◆ InstructionCost() [1/3]
llvm::InstructionCost::InstructionCost |
( |
| ) |
|
|
default |
◆ InstructionCost() [2/3]
llvm::InstructionCost::InstructionCost |
( |
CostState |
| ) |
|
|
delete |
◆ InstructionCost() [3/3]
llvm::InstructionCost::InstructionCost |
( |
CostType |
Val | ) |
|
|
inline |
◆ getInvalid()
◆ getState()
CostState llvm::InstructionCost::getState |
( |
| ) |
const |
|
inline |
◆ getValue()
◆ isValid()
bool llvm::InstructionCost::isValid |
( |
| ) |
const |
|
inline |
◆ map()
template<class Function >
◆ operator!=() [1/2]
bool llvm::InstructionCost::operator!= |
( |
const CostType |
RHS | ) |
const |
|
inline |
◆ operator!=() [2/2]
◆ operator*=() [1/2]
◆ operator*=() [2/2]
◆ operator++() [1/2]
◆ operator++() [2/2]
◆ operator+=() [1/2]
◆ operator+=() [2/2]
For all of the arithmetic operators provided here any invalid state is perpetuated and cannot be removed.
Once a cost becomes invalid it stays invalid, and it also inherits any invalid state from the RHS. Regardless of the state, arithmetic and comparisons work on the actual values in the same way as they would on a basic type, such as integer.
Definition at line 80 of file InstructionCost.h.
◆ operator--() [1/2]
◆ operator--() [2/2]
◆ operator-=() [1/2]
◆ operator-=() [2/2]
◆ operator/=() [1/2]
◆ operator/=() [2/2]
◆ operator<() [1/2]
bool llvm::InstructionCost::operator< |
( |
const CostType |
RHS | ) |
const |
|
inline |
◆ operator<() [2/2]
For the comparison operators we have chosen to use lexicographical ordering where valid costs are always considered to be less than invalid costs.
This avoids having to add asserts to the comparison operators that the states are valid and users can test for validity of the cost explicitly.
Definition at line 155 of file InstructionCost.h.
◆ operator<=() [1/2]
bool llvm::InstructionCost::operator<= |
( |
const CostType |
RHS | ) |
const |
|
inline |
◆ operator<=() [2/2]
◆ operator==() [1/2]
bool llvm::InstructionCost::operator== |
( |
const CostType |
RHS | ) |
const |
|
inline |
◆ operator==() [2/2]
◆ operator>() [1/2]
bool llvm::InstructionCost::operator> |
( |
const CostType |
RHS | ) |
const |
|
inline |
◆ operator>() [2/2]
◆ operator>=() [1/2]
bool llvm::InstructionCost::operator>= |
( |
const CostType |
RHS | ) |
const |
|
inline |
◆ operator>=() [2/2]
◆ print()
◆ setInvalid()
void llvm::InstructionCost::setInvalid |
( |
| ) |
|
|
inline |
◆ setValid()
void llvm::InstructionCost::setValid |
( |
| ) |
|
|
inline |
The documentation for this class was generated from the following files: