LLVM 19.0.0git
Classes | Namespaces | Functions
InstructionCost.h File Reference

This file defines an InstructionCost class that is used when calculating the cost of an instruction, or a group of instructions. More...

#include "llvm/Support/MathExtras.h"
#include <limits>
#include <optional>

Go to the source code of this file.

Classes

class  llvm::InstructionCost
 

Namespaces

namespace  llvm
 This is an optimization pass for GlobalISel generic memory operations.
 

Functions

InstructionCost llvm::operator+ (const InstructionCost &LHS, const InstructionCost &RHS)
 
InstructionCost llvm::operator- (const InstructionCost &LHS, const InstructionCost &RHS)
 
InstructionCost llvm::operator* (const InstructionCost &LHS, const InstructionCost &RHS)
 
InstructionCost llvm::operator/ (const InstructionCost &LHS, const InstructionCost &RHS)
 
raw_ostream & llvm::operator<< (raw_ostream &OS, const InstructionCost &V)
 

Detailed Description

This file defines an InstructionCost class that is used when calculating the cost of an instruction, or a group of instructions.

In addition to a numeric value representing the cost the class also contains a state that can be used to encode particular properties, such as a cost being invalid. Operations on InstructionCost implement saturation arithmetic, so that accumulating costs on large cost-values don't overflow.

Definition in file InstructionCost.h.