From Cambridge Dictionary:Throughput /ˈθruː.pʊt/ (noun)an amount of work done in a particular period of time.In architecture-level performance analysis, throughput is usually measured by IPC – Instruction Per Cycle. The inverse of this property, namely, inverse or reciprocal throughput, is also commonly used to describe the performance characteristics of a sinlge instruction. It’s not the time an instruction spends on to finish from start to end – that is latency – but more closed to the amount of time it takes to finish a bunch of instructions amortized by their degree of (instruction-level) parallelism.LLVM’s scheduling model – which we’d covered in several posts previously – is a huge database describing the performance characteristics of instructions in a specific processor. While it specifies the instruction latency, a scheduling model does not spells out the inverse throughput of each instruction. We are, however, able to derive this property from other metrics in the model, and this short post is dedicated to show you how to do it.Scheduling model in a nutshellA scheduling model in LLVM describes an instruction with three primary properties:LatencyHardware resources it usesNumber of cycles it “holds” on each of these hardware resourcesA hardware resource can be thought as an execution pipe in a superscalar processor. Let’s say we have an instruction BLAH which uses three pipes, Pipe0 to Pipe2 (P0 ~ P2), during its execution. We can describe the number of cycles it holds on each of these three pipes with a pair of numbers: AcquireAtCycle and ReleaseAtCycle.AcquireAtCycle equals to the cycle where BLAH grabs a certain pipe and start working, relative to the cycle when instruction was issued, this value is usually zero, meaning this instruction starts using this resource as soon as it was issued – we’ll talk about the scenario where it’s NOT (spoiler alert: it has more fun), but right now let’s just assume it’s always zero; similarly, ReleaseAtCycle is the cycle...
First seen: 2025-03-30 13:33
Last seen: 2025-03-30 14:33