Removing Branching Paths from Computer Program Code

Resolve Bottlenecks,
Find Innovative Solutions
Generate Solutions

Solution Overview

Problem

Modern processors face significant execution stalls due to branching instructions, which create combinatorial explosion of paths and hinder efficient execution, as existing branch predictors struggle to deterministically predict branch outcomes, leading to inefficiencies.

Innovation Solution

A system and method that removes branching paths by computing the result of branching paths at runtime, prefetching independent instructions, executing them, and removing if statements within jump instructions, while generating versioned dependency graphs to optimize code and insert additional independent instructions during compilation.

Engineering Contradictions & Design Principles

VSEngineering Contradiction Analysis

1Measurement precision

If branch predictors are used to handle branching instructions, then branch prediction accuracy is improved, but execution stalls and pipeline efficiency deteriorate due to mispredicted branches and combinatorial explosion of paths

Engineering Contradiction:
Improvebranch prediction accuracyVSAvoidexecution speed
Core Design Contradiction:
Measurement precisionVSProductivity

Solution Approach 1:

The patent extracts and removes branching instructions from the code base entirely, transforming conditional logic into iterative patterns. This eliminates the need for branch prediction mechanisms and their associated performance penalties, directly resolving the contradiction by removing the source of both prediction needs and execution stalls

Inventive Principle:
Principle #2Taking out (Extraction)

Solution Approach 2:

The patent dynamically transforms static branching structures into dynamic iterative structures that can adapt to different execution paths without requiring prediction. The iterative approach allows the processor to maintain steady pipeline flow by eliminating unpredictable jumps while preserving all necessary execution paths through loop constructs

Inventive Principle:
Principle #15Dynamics

2Reliability

If branching instructions are retained in code, then program logic and control flow are preserved, but processor efficiency and execution throughput deteriorate due to pipeline stalls

Engineering Contradiction:
Improveprogram logic correctnessVSAvoidexecution throughput
Core Design Contradiction:
ReliabilityVSProductivity

Solution Approach 1:

The patent replaces irregular branching actions with periodic iterative actions. By structuring code as loops with clear entry and exit points rather than scattered conditional jumps, the processor can maintain regular pipeline rhythm while preserving all necessary control flow logic through systematic iteration patterns

Inventive Principle:
Principle #19Periodic action

3Adaptability or versatility

If branch predictors are implemented to handle complex branching paths, then branch handling capability is improved, but device complexity and memory requirements deteriorate

Engineering Contradiction:
Improvebranch handling capabilityVSAvoidprocessor complexity
Core Design Contradiction:
Adaptability or versatilityVSDevice complexity

Solution Approach 1:

The patent removes the need for complex branch prediction hardware and algorithms by extracting branching instructions from the codebase entirely. This simplifies the processor architecture by eliminating sophisticated prediction logic while maintaining full program functionality through iterative refactoring of control structures

Inventive Principle:
Principle #2Taking out (Extraction)

Data Source

PatentUS11893368B2Removing branching paths from a computer program
Publication Date: 2024.02.06 MANYCORE CORP
  • US11893368B2 patent drawing
  • US11893368B2 patent drawing
  • US11893368B2 patent drawing

AI summary

Methods and systems are described for removing branches from a computer program. The system receives code for a computer program, with the code including a number of branches. Each branch is part of a branching path and includes a jump instruction. The system executes the code, and upon encountering a branching path at runtime, the system proceeds with a number of steps. First, the system computes the result of the branch, then prefetches independent instructions outside of the branch to be executed. The system then executes one or more of the prefetched independent instructions and removes an if statement within the jump instruction of the branch at the computed result of the branching path. The system then executes the jump instruction of the branch at the computed result of the branching path.