Go to the documentation of this file.
18 #ifndef LLVM_SUPPORT_INSTRUCTIONCOST_H
19 #define LLVM_SUPPORT_INSTRUCTIONCOST_H
105 Result =
RHS.Value > 0 ? getMaxValue() : getMinValue();
123 Result =
RHS.Value > 0 ? getMinValue() : getMaxValue();
141 Result = getMaxValue();
143 Result = getMinValue();
196 if (State !=
RHS.State)
197 return State <
RHS.State;
204 return !(*
this <
RHS) && !(
RHS < *
this);
211 return *
this == RHS2;
234 return *
this <= RHS2;
239 return *
this >= RHS2;
244 template <
class Function>
bool operator>(const InstructionCost &RHS) const
InstructionCost & operator+=(const CostType RHS)
This is an optimization pass for GlobalISel generic memory operations.
bool operator>=(const CostType RHS) const
auto map(const Function &F) const -> InstructionCost
CostState
CostState describes the state of a cost.
InstructionCost & operator++()
InstructionCost()=default
bool operator<=(const InstructionCost &RHS) const
bool operator>(const CostType RHS) const
Expected< ExpressionValue > max(const ExpressionValue &Lhs, const ExpressionValue &Rhs)
bool operator<=(const CostType RHS) const
void print(raw_ostream &OS) const
InstructionCost & operator--()
InstructionCost & operator/=(const InstructionCost &RHS)
bool operator<(const CostType RHS) const
InstructionCost operator/(const InstructionCost &LHS, const InstructionCost &RHS)
InstructionCost & operator+=(const InstructionCost &RHS)
For all of the arithmetic operators provided here any invalid state is perpetuated and cannot be remo...
This class implements an extremely fast bulk output stream that can only output to a stream.
bool operator==(const CostType RHS) const
bool operator!=(const InstructionCost &RHS) const
raw_ostream & operator<<(raw_ostream &OS, const APFixedPoint &FX)
std::enable_if_t< std::is_signed< T >::value, T > AddOverflow(T X, T Y, T &Result)
Add two signed integers, computing the two's complement truncated result, returning true if overflow ...
bool operator<(const InstructionCost &RHS) const
For the comparison operators we have chosen to use lexicographical ordering where valid costs are alw...
std::optional< CostType > getValue() const
This function is intended to be used as sparingly as possible, since the class provides the full rang...
APInt operator+(APInt a, const APInt &b)
bool operator!=(const CostType RHS) const
APInt operator*(APInt a, uint64_t RHS)
InstructionCost operator--(int)
Expected< ExpressionValue > min(const ExpressionValue &Lhs, const ExpressionValue &Rhs)
static InstructionCost getMin()
InstructionCost & operator*=(const InstructionCost &RHS)
InstructionCost & operator-=(const CostType RHS)
InstructionCost & operator-=(const InstructionCost &RHS)
static InstructionCost getMax()
std::enable_if_t< std::is_signed< T >::value, T > MulOverflow(T X, T Y, T &Result)
Multiply two signed integers, computing the two's complement truncated result, returning true if an o...
bool operator==(const InstructionCost &RHS) const
std::enable_if_t< std::is_signed< T >::value, T > SubOverflow(T X, T Y, T &Result)
Subtract two signed integers, computing the two's complement truncated result, returning true if an o...
static InstructionCost getInvalid(CostType Val=0)
InstructionCost operator++(int)
@ Invalid
< The cost value represents a valid cost, even when the cost-value is large.
CostState getState() const
bool operator>=(const InstructionCost &RHS) const
InstructionCost & operator/=(const CostType RHS)
LLVM Value Representation.
InstructionCost(CostType Val)
InstructionCost & operator*=(const CostType RHS)