Vector Code Pattern Replacement for Faster Lane Rearrangement

Resolve Bottlenecks,
Find Innovative Solutions
Generate Solutions

Solution Overview

Problem

Existing software development using Java® Vector API experiences slow execution times when manipulating vector data, particularly when using the rearrange() method to move data across lane boundaries.

Innovation Solution

A computer-implemented method that identifies and automatically replaces specific code patterns (v0.rearrange(s, v1), v0.blend(v1, m), or v0.rearrange(s).blend(v1.rearrange(s), m) with alternative patterns to improve execution time, utilizing the blend() method to select vector lanes based on Boolean values.

Engineering Contradictions & Design Principles

VSEngineering Contradiction Analysis

1Adaptability or versatility

If the rearrange() method is used to move data across lane boundaries in vector operations, then data manipulation flexibility is improved, but execution time increases

Engineering Contradiction:
Improvedata manipulation flexibilityVSAvoidexecution time
Core Design Contradiction:
Adaptability or versatilityVSLoss of time

Solution Approach 1:

The patent creates alternative code versions that copy and transform the original code containing rearrange() calls. These copied versions use blend() operations instead, which execute faster while producing equivalent results. The system generates multiple code variants and selects the optimal one based on performance criteria.

Inventive Principle:
Principle #26Copying

Solution Approach 2:

The patent transforms the code by changing the operational parameters from rearrange() to blend(). This parameter substitution replaces expensive lane boundary operations with more efficient blend operations that achieve the same data manipulation goals without crossing lane boundaries, thereby reducing execution time.

Inventive Principle:
Principle #35Parameter changes

2Loss of time

If manual code rewriting is performed to optimize vector operations, then execution time is improved, but development complexity and time increase

Engineering Contradiction:
Improveexecution timeVSAvoiddevelopment complexity
Core Design Contradiction:
Loss of timeVSDevice complexity

Solution Approach 1:

The patent implements a self-service optimization system where the code transformation tool automatically analyzes, transforms, and optimizes the code without requiring manual intervention from developers. The system services itself by identifying optimization opportunities, generating alternative code versions, and selecting the best variant automatically, eliminating the need for developers to manually rewrite code for performance optimization.

Inventive Principle:
Principle #25Self-service

Solution Approach 2:

The patent performs preliminary code transformation and optimization before the code is executed. By pre-analyzing the code, generating optimized variants, and selecting the best version in advance, the system eliminates the need for runtime optimization or manual rewriting, thereby reducing both execution time and development complexity.

Inventive Principle:
Principle #10Preliminary action

3Loss of time

If the blend() method is used instead of rearrange(), then execution time is reduced, but code complexity increases

Engineering Contradiction:
Improveexecution timeVSAvoidcode complexity
Core Design Contradiction:
Loss of timeVSDevice complexity

Solution Approach 1:

The patent segments the code transformation process into distinct phases: analysis of original code, generation of alternative variants using blend(), performance evaluation, and selection of optimal code. This segmentation manages complexity by breaking down the transformation task into manageable steps, making the overall process more controllable and maintainable despite the increased complexity of the transformation logic itself.

Inventive Principle:
Principle #1Segmentation

Data Source

PatentUS12632234B2Automatically replacing code in program that manipulates two vectors of data to improve execution time
Publication Date: 2026.05.19 INTERNATIONAL BUSINESS MACHINE CORPORATION
  • US12632234B2 patent drawing
  • US12632234B2 patent drawing
  • US12632234B2 patent drawing

AI summary

A computer-implemented method, system and computer program product for improving the performance of a program that manipulates two vectors of data. It is determined whether the program contains one of the following patterns: a first pattern corresponding to v0.rearrange(s, v1); a second pattern corresponding to v0.blend(v1, m); and a third pattern corresponding to v0.rearrange(s).blend(v1.rearrange(s), m). Upon identifying code written as the first pattern in the program, the first pattern is rewritten and replaced with the second or third pattern if the execution time of the program with the second or third pattern is less than the execution time of the program with the first program. In a similar manner, upon identifying code written as the second or third pattern in the program, the second or third pattern is rewritten and replaced with the first pattern if the execution time of the program can be improved.