Calculating Reciprocal Throughput in LLVM's Scheduling Model
This post delves into the calculation of reciprocal throughput within LLVM's instruction scheduling model. LLVM's scheduling model describes an instruction with three key properties: latency, hardware resources used, and the number of cycles it holds each resource. While the traditional approach uses the maximum release cycle to calculate reciprocal throughput, this breaks down when non-zero acquire cycles are present. By analyzing resource segments and the instruction scheduling process, the author derives a new method: using the length of the longest segment across all hardware resources as the reciprocal throughput. This addresses the shortcomings of the traditional method when dealing with resource segments, providing a more accurate basis for performance optimization in the LLVM compiler.