Detecting memory-hazard conflicts during vector processing
AssigneeApple Inc.
InventorsJeffry E. Gonion, Keith E. Diefendorff
Life of this patent
Estimating the term…
Abstract
A method for performing parallel operations in a computer system when one or more memory hazards may be present, which may be implemented by a processor, is described. During operation, the processor receives instructions for detecting conflict between memory addresses in vectors when memory operations are performed in parallel using at least a portion of the vectors, and tracking positions in at least one of the vectors of any detected conflict between the memory addresses. Next, the processor executes the instructions for detecting the conflict between the memory addresses and tracking the positions.
Claims26
A method for performing parallel operations in a computer system when one or more memory hazards may be present, comprising:
- receiving instructions for detecting conflict between memory addresses in vectors when memory operations are performed in parallel using at least a portion of the vectors, and tracking positions in at least one of the vectors of any detected conflict between the memory addresses, wherein the instructions are inserted in program code prior to runtime, and wherein the conflict between memory addresses includes a conflict that is data-dependent and therefore cannot be detected until after the memory addresses have been resolved at runtime;
- and
- executing the instructions for detecting the conflict between the memory addresses and tracking the positions, wherein executing the instructions causes a processor to detect the conflict between the memory addresses and to track the positions, and wherein while executing the instructions, the processor generates one or more stop indicators based on the tracked positions in the at least one of the vectors, wherein the one or more stop indicators indicate positions to break the at least one of the vectors into sub-vectors to ensure correct program behavior when the memory operations are performed in parallel.
A compiler configured to generate instructions based on a feature set of a processor, wherein the processor is configured to:
- receive instructions for detecting conflict between memory addresses in vectors when memory operations are performed in parallel using at least a portion of the vectors, and tracking positions in at least one of the vectors of any detected conflict between the memory addresses, wherein the instructions are inserted in program code prior to runtime, and wherein the conflict between memory addresses includes a conflict that is data-dependent and therefore cannot be detected until after the memory addresses have been resolved at runtime;
- and
- execute the instructions for detecting the conflict between the memory addresses and tracking the positions, wherein executing the instructions causes a processor to detect the conflict between the memory addresses and to track the positions, and wherein while executing the instructions, the processor generates one or more stop indicators based on the tracked positions in the at least one of the vectors, wherein the one or more stop indicators indicate positions to break the at least one of the vectors into sub-vectors to ensure correct program behavior when the memory operations are performed in parallel.
A computer system configured to execute instructions to avoid one or more memory hazards while performing parallel operations, comprising:
- a processor;
- a memory;
- an instruction fetch unit within the processor configured to fetch:
- instructions for detecting conflict between memory addresses in vectors when memory operations are performed in parallel using at least a portion of the vectors, and tracking positions in at least one of the vectors of any detected conflict between the memory addresses, wherein the instructions are inserted in program code prior to runtime, and wherein the conflict between memory addresses includes a conflict that is data-dependent and therefore cannot be detected until after the memory addresses have been resolved at runtime;
- and
- instructions for executing the instructions for detecting the conflict between the memory addresses and tracking the positions, wherein executing the instructions causes a processor to detect the conflict between the memory addresses and to track the positions, and wherein while executing the instructions, the processor generates one or more stop indicators based on the tracked positions in the at least one of the vectors, wherein the one or more stop indicators indicate positions to break the at least one of the vectors into sub-vectors to ensure correct program behavior when the memory operations are performed in parallel.
Dependencies are inferred from the claim text.