23#define DEBUG_TYPE "llvm-mca"
26 if (Denominator ==
RHS.Denominator)
27 Numerator +=
RHS.Numerator;
31 unsigned GCD = std::gcd(Denominator,
RHS.Denominator);
32 unsigned LCM = (Denominator *
RHS.Denominator) / GCD;
33 unsigned LHSNumerator = Numerator * (LCM / Denominator);
34 unsigned RHSNumerator =
RHS.Numerator * (LCM /
RHS.Denominator);
35 Numerator = LHSNumerator + RHSNumerator;
43 unsigned ProcResourceID = 0;
46 "Invalid number of elements");
51 for (
unsigned I = 1,
E =
SM.getNumProcResourceKinds();
I <
E; ++
I) {
53 if (
Desc.SubUnitsIdxBegin)
55 Masks[
I] = 1ULL << ProcResourceID;
60 for (
unsigned I = 1,
E =
SM.getNumProcResourceKinds();
I <
E; ++
I) {
62 if (!
Desc.SubUnitsIdxBegin)
64 Masks[
I] = 1ULL << ProcResourceID;
65 for (
unsigned U = 0; U <
Desc.NumUnits; ++U) {
67 Masks[
I] |= OtherMask;
75 dbgs() <<
"\nProcessor resource masks:\n";
76 for (
unsigned I = 0,
E =
SM.getNumProcResourceKinds();
I <
E; ++
I) {
90 double Max =
static_cast<double>(NumMicroOps) / DispatchWidth;
95 for (
unsigned I = 0,
E =
SM.getNumProcResourceKinds();
I <
E; ++
I) {
102 Max = std::max(Max, Throughput);
assert(UImm &&(UImm !=~static_cast< T >(0)) &&"Invalid immediate!")
static GCRegistry::Add< CoreCLRGC > E("coreclr", "CoreCLR-compatible GC")
static constexpr unsigned SM(unsigned Version)
ArrayRef - Represent a constant reference to an array (0 or more elements consecutively in memory),...
size_t size() const
size - Get the array size.
MutableArrayRef - Represent a mutable reference to an array (0 or more elements consecutively in memo...
This class represents the number of cycles per resource (fractions of cycles).
LLVM_ABI ReleaseAtCycles & operator+=(const ReleaseAtCycles &RHS)
Helper functions used by various pipeline components.
LLVM_ABI double computeBlockRThroughput(const MCSchedModel &SM, unsigned DispatchWidth, unsigned NumMicroOps, ArrayRef< unsigned > ProcResourceUsage)
Compute the reciprocal block throughput from a set of processor resource cycles.
LLVM_ABI void dumpProcResourceMasks(const MCSchedModel &SM, ArrayRef< uint64_t > Masks)
LLVM_ABI void computeProcResourceMasks(const MCSchedModel &SM, MutableArrayRef< uint64_t > Masks)
Populates vector Masks with processor resource masks.
This is an optimization pass for GlobalISel generic memory operations.
FormattedNumber format_decimal(int64_t N, unsigned Width)
format_decimal - Output N as a right justified, fixed-width decimal.
LLVM_ABI raw_ostream & dbgs()
dbgs() - This returns a reference to a raw_ostream for debugging messages.
FormattedNumber format_hex(uint64_t N, unsigned Width, bool Upper=false)
format_hex - Output N as a fixed width hexadecimal.
Define a kind of processor resource that will be modeled by the scheduler.
Machine model for scheduling, bundling, and heuristics.