Loop Unrolling Apparatus Adjusting Stage Number via Remainder

Resolve Bottlenecks,
Find Innovative Solutions
Generate Solutions

Solution Overview

Problem

Existing loop unrolling techniques do not efficiently optimize processing after loop unrolling, as the unroll stage number often results in similar processing overhead to the original loop processing, particularly when the number of looping times is not evenly divisible by the unroll stage number.

Innovation Solution

A loop unrolling processing apparatus and method that generates arithmetic expressions to adjust the unroll stage number based on the remainder of the division of looping times by the unroll stage number, allowing for efficient processing by executing loop processing with adjusted unroll stage numbers, thereby reducing processing time.

Engineering Contradictions & Design Principles

VSEngineering Contradiction Analysis

1Productivity

If the unroll stage number is increased to reduce looping times and determination processing overhead, then the performance of loop processing is improved, but the register capacity becomes insufficient and data transfer from register to memory increases, causing performance deterioration

Engineering Contradiction:
Improveloop processing performanceVSAvoidregister capacity
Core Design Contradiction:
ProductivityVSQuantity of substance

Solution Approach 1:

The patent divides the loop processing into multiple segments based on the remainder of division. When N % L ≠ 0, it separates the processing into (N - (N % L)) iterations with unroll stage L and (N % L) iterations with unroll stage 1. This segmentation allows the system to handle the majority of iterations efficiently with higher unroll stages while managing the remainder iterations separately, preventing register capacity overflow.

Inventive Principle:
Principle #1Segmentation

Solution Approach 2:

The patent dynamically adjusts the unroll stage number based on the iteration count and remainder conditions. Instead of using a fixed unroll stage number, the system changes the unroll stage dynamically: using stage L for most iterations and stage 1 for remainder iterations. This dynamic adjustment optimizes performance by adapting to the specific execution context while managing register usage.

Inventive Principle:
Principle #15Dynamics

2Loss of time

If loop unrolling is performed with a fixed unroll stage number, then the number of looping times is decreased, but the processing overhead remains similar when the number of looping times is not evenly divisible by the unroll stage number

Engineering Contradiction:
Improvedetermination processing overheadVSAvoidprocessing efficiency
Core Design Contradiction:
Loss of timeVSProductivity

Solution Approach 1:

The patent segments the loop processing into two distinct parts: the main body with (N - (N % L)) iterations processed with unroll stage L, and the remainder with (N % L) iterations processed with unroll stage 1. This segmentation ensures that the determination processing overhead is minimized for the majority of iterations while the remainder is handled efficiently with a smaller unroll stage, eliminating the waste of processing overhead.

Inventive Principle:
Principle #1Segmentation

Solution Approach 2:

The patent changes the unroll stage parameter dynamically based on the iteration context. For the main body of iterations where N % L = 0, it uses unroll stage L to minimize determination overhead. For the remainder iterations where N % L ≠ 0, it switches to unroll stage 1. This parameter change optimizes processing efficiency by matching the unroll stage to the specific execution context.

Inventive Principle:
Principle #35Parameter changes

3Device complexity

If the unroll stage number is increased too much, then the number of determination processes is decreased, but the amount of processing per one loop becomes too large, causing register capacity to become insufficient

Engineering Contradiction:
Improvedetermination process complexityVSAvoidregister capacity requirement
Core Design Contradiction:
Device complexityVSQuantity of substance

Solution Approach 1:

The patent segments the processing into multiple loops with different unroll stages. The first loop handles (N - (N % L)) iterations with unroll stage L, and the second loop handles (N % L) iterations with unroll stage 1. This segmentation prevents any single loop from requiring excessive register capacity while still reducing overall determination process complexity through the use of unroll stage L for the majority of iterations.

Inventive Principle:
Principle #1Segmentation

Data Source

PatentUS12093691B2Loop unrolling processing apparatus, method, and program
Publication Date: 2024.09.17 NEC CORP
  • US12093691B2 patent drawing
  • US12093691B2 patent drawing
  • US12093691B2 patent drawing

AI summary

A generation unit generates arithmetic expressions. Here, N denotes the number of looping times of the loop processing. L denotes a designated lower limit of unroll stage number. M denotes a designated upper limit of the unroll stage number. Q denotes a quotient obtained by dividing N by L. R denotes a remainder obtained by dividing N by L. The arithmetic expressions include an arithmetic expression that represents executing loop processing whose number of looping times is a quotient obtained by dividing R by (M−L), with the unroll stage number M when R−Q*(M−L)>0 is not satisfied, and then executing, when a remainder obtained by dividing R by (M−L) is other than 0, processing of one loop with sum of the remainder and L as the unroll stage number, and then executing loop processing with the unroll stage number L.