15 #ifndef LLVM_MCA_SUPPORT_H 16 #define LLVM_MCA_SUPPORT_H 34 : Message(
std::move(M)), Inst(MCI) {}
52 unsigned Numerator, Denominator;
57 : Numerator(Cycles), Denominator(ResourceUnits) {}
59 operator double()
const {
60 assert(Denominator &&
"Invalid denominator (must be non-zero).");
61 return (Denominator == 1) ? Numerator : (double)Numerator / Denominator;
68 if (Denominator == RHS.Denominator)
69 Numerator += RHS.Numerator;
74 unsigned LCM = (Denominator * RHS.Denominator) / GCD;
75 unsigned LHSNumerator = Numerator * (LCM / Denominator);
76 unsigned RHSNumerator = RHS.Numerator * (LCM / RHS.Denominator);
77 Numerator = LHSNumerator + RHSNumerator;
114 unsigned NumMicroOps,
119 #endif // LLVM_MCA_SUPPORT_H
uint64_t GreatestCommonDivisor64(uint64_t A, uint64_t B)
Return the greatest common divisor of the values using Euclid's algorithm.
This class represents lattice values for constants.
ResourceCycles & operator+=(const ResourceCycles &RHS)
std::error_code convertToErrorCode() const override
Convert this error to a std::error_code.
InstructionError(std::string M, const T &MCI)
double computeBlockRThroughput(const MCSchedModel &SM, unsigned DispatchWidth, unsigned NumMicroOps, ArrayRef< unsigned > ProcResourceUsage)
Compute the reciprocal block throughput from a set of processor resource cycles.
void computeProcResourceMasks(const MCSchedModel &SM, MutableArrayRef< uint64_t > Masks)
Populates vector Masks with processor resource masks.
MutableArrayRef - Represent a mutable reference to an array (0 or more elements consecutively in memo...
void log(raw_ostream &OS) const override
Print an error message to an output stream.
This class represents the number of cycles per resource (fractions of cycles).
Base class for user error types.
ResourceCycles(unsigned Cycles, unsigned ResourceUnits=1)
assert(ImpDefSCC.getReg()==AMDGPU::SCC &&ImpDefSCC.isDef())
This class implements an extremely fast bulk output stream that can only output to a stream...
Machine model for scheduling, bundling, and heuristics.
std::error_code inconvertibleErrorCode()
The value returned by this function can be returned from convertToErrorCode for Error values where no...