Hardware Strided Prefetching for Loop-Unrolled Instructions
Find Innovative SolutionsGenerate Solutions
Solution Overview
Problem
Hardware-based strided prefetching is ineffective in loop-unrolled code due to increased complexity and limited stride-tracking records, leading to thrashing, aliasing, and reduced prefetching effectiveness.
Innovation Solution
A method where a computer processor determines loop-unrolled instructions are grouped and maps each instruction to a shared stride-tracking record using a predefined mapping function based on instruction address, iteration group index, and instruction byte count, enabling efficient data prefetching.
Engineering Contradictions & Design Principles
Engineering Contradiction Analysis
1Measurement precision
If loop-unrolled instructions are monitored with separate stride-tracking records for each instruction address, then each instruction can be tracked individually, but the number of required records increases significantly causing thrashing, aliasing, and contention
Solution Approach 1:
The patent merges multiple stride-tracking records into a single shared record by mapping loop-unrolled instructions to the same record identifier. Instead of maintaining separate records for each instruction address (array1[i], array1[i+1], etc.), the system uses a mapping function that combines the instruction address and loop index to generate a single record ID, thereby reducing the total number of records required and eliminating thrashing and contention issues
Solution Approach 2:
The shared stride-tracking record serves multiple functions by tracking stride information for multiple loop-unrolled instructions simultaneously. A single record is used to monitor and prefetch data for entire groups of loop-unrolled instructions, making the stride-tracking mechanism universal rather than instruction-specific, which reduces resource requirements while maintaining prefetching effectiveness
2Productivity
If hardware-based strided prefetching is applied to loop-unrolled code with limited stride-tracking records, then prefetching can occur, but record contention and aliasing reduce prefetching effectiveness
Solution Approach 1:
The patent introduces a mapping function as an intermediary between loop-unrolled instructions and stride-tracking records. This mapping function takes the instruction address and loop index as inputs and generates a shared record identifier, acting as a mediator that consolidates multiple instruction tracking requirements into a single record while maintaining the ability to distinguish and track individual instruction patterns within the loop-unrolled sequence
3Ease of operation
If multiple stride-tracking records are used for loop-unrolled instructions, then each instruction can be monitored separately, but the history table experiences thrashing reducing overall performance
Solution Approach 1:
The patent combines multiple instruction monitoring operations into a single shared stride-tracking record. By mapping loop-unrolled instructions to the same record, the system maintains the ability to monitor instruction patterns while eliminating the performance degradation caused by thrashing in the history table, thus preserving monitoring capability without sacrificing processor performance
Data Source
AI summary
Prefetching data by determining that a first set of instructions that is processed by a computer processor indicates that a second set of instructions includes multiple iteration groups, where each of the iteration groups includes one or more loop-unrolled instructions, monitoring the second set of instructions as the second set of instructions is processed by the computer processor after the first set of instructions is processed by the computer processor, mapping a corresponding one of the loop-unrolled instructions in each of the iteration groups of the second set of instructions to a stride-tracking record that is shared by the corresponding loop-unrolled instructions, and prefetching data into a cache memory of the computer processor based on the stride-tracking record.

