Compiler Loop Splitting for Vector Processing

Resolve Bottlenecks,
Find Innovative Solutions
Generate Solutions

Solution Overview

Problem

Conventional compilers fail to optimize vector processing loops with unknown trip counts, missing opportunities for execution efficiency and hardware implementation optimization due to limitations in loop splitting and unrolling techniques.

Innovation Solution

A method that determines the presence of vector data types in loops, splits loops into multiple loops based on a splitting factor, and unrolls the second loop, allowing for efficient execution and hardware synthesis even when the trip count is unknown at compile time.

Engineering Contradictions & Design Principles

VSEngineering Contradiction Analysis

1Productivity

If loop unrolling is applied to vector processing loops with unknown trip counts, then execution efficiency is improved, but the compiler cannot determine how many times to unroll the loop

Engineering Contradiction:
Improveexecution efficiencyVSAvoidtrip count information
Core Design Contradiction:
ProductivityVSLoss of information

Solution Approach 1:

The patent divides the original loop with unknown trip count into multiple segmented loops, each with a known trip count. By splitting the loop body into several parts and creating separate loop structures, the compiler can apply unrolling to each segment independently while preserving the overall loop functionality. This segmentation allows optimization to proceed despite the unknown total iteration count.

Inventive Principle:
Principle #1Segmentation

2Productivity

If loop splitting is performed to enable unrolling, then the loop can be optimized, but the loop structure becomes more complex

Engineering Contradiction:
Improveruntime efficiencyVSAvoidloop structure complexity
Core Design Contradiction:
ProductivityVSDevice complexity

Solution Approach 1:

The loop is segmented into multiple loops with known trip counts, allowing unrolling optimization. While this increases structural complexity, the segmentation enables runtime efficiency improvements that outweigh the structural overhead.

Inventive Principle:
Principle #1Segmentation

Solution Approach 2:

Instead of attempting to unroll the entire loop with unknown trip count, the patent applies unrolling partially to segmented portions where trip counts are known. This partial action approach achieves optimization without requiring complete loop transformation, balancing complexity and efficiency.

Inventive Principle:
Principle #16Partial or excessive action

3Manufacturing precision

If the compiler applies optimizations assuming known trip count, then optimization quality improves, but incorrect assumptions lead to wrong code generation

Engineering Contradiction:
Improveoptimization qualityVSAvoidcode correctness
Core Design Contradiction:
Manufacturing precisionVSReliability

Solution Approach 1:

The patent applies optimizations only to the extent that trip count information is available. By optimizing partial segments rather than making assumptions about the entire loop, the compiler maintains both optimization quality and code correctness, avoiding incorrect transformations while still achieving performance improvements.

Inventive Principle:
Principle #16Partial or excessive action

Data Source

PatentUS12182552B2Splitting vector processing loops with an unknown trip count
Publication Date: 2024.12.31 XILINX INC
  • US12182552B2 patent drawing
  • US12182552B2 patent drawing
  • US12182552B2 patent drawing

AI summary

A computer-based technique for processing an application includes determining that a loop of the application includes a reference to a data item of a vector data type. A trip count of the loop is determined to have an unknown trip count. The loop is split into a first loop and a second loop based on a splitting factor. The second loop is unrolled.