Compiler Expression Reuse via Rewrite Rules and Cost Selection

Resolve Bottlenecks,
Find Innovative Solutions
Generate Solutions

Solution Overview

Problem

Conventional compiler optimizations struggle with identifying and removing non-trivial redundancies in expressions due to the exponential increase in equivalent expressions, leading to increased compile time and reduced execution benefits.

Innovation Solution

A compiler transformation technique using rewrite rules to generate equivalent expressions, constrained by commutativity, associativity, and distributivity, to identify and replace non-trivial redundancies with reusable expressions, optimizing the intermediate representation.

Engineering Contradictions & Design Principles

VSEngineering Contradiction Analysis

1Reliability

If the compiler generates all equivalent expressions to identify non-trivial redundancies, then the optimization completeness is improved, but the compile time increases exponentially

Engineering Contradiction:
Improveoptimization completenessVSAvoidcompile time
Core Design Contradiction:
ReliabilityVSLoss of time

Solution Approach 1:

The patent changes the parameter of expression generation by introducing rewrite rules that constrain the transformation process. Instead of generating all possible equivalent expressions, the system applies a limited set of algebraic rewrite rules (commutativity, associativity, distributivity) to generate only relevant equivalent forms, thereby reducing compile time while maintaining optimization effectiveness

Inventive Principle:
Principle #35Parameter changes

Solution Approach 2:

The patent applies partial action by selecting and applying only the necessary rewrite rules from the set of all possible algebraic transformations. The system generates equivalent expressions using a controlled subset of rewrite rules rather than exhaustively exploring all possible transformations, achieving sufficient optimization without the exponential time cost

Inventive Principle:
Principle #16Partial or excessive action

2Reliability

If the compiler applies more aggressive expression transformations, then the redundancy removal is improved, but the device complexity increases

Engineering Contradiction:
Improveredundancy removalVSAvoidcompiler complexity
Core Design Contradiction:
ReliabilityVSDevice complexity

Solution Approach 1:

The patent manages device complexity by parameterizing the transformation process through a structured set of rewrite rules. Each rule corresponds to a specific algebraic property (commutativity, associativity, distributivity), providing a controlled and manageable approach to expression transformation that avoids the complexity of general equivalence checking

Inventive Principle:
Principle #35Parameter changes

Solution Approach 2:

The patent segments the complex expression transformation problem into discrete, manageable rewrite rules. By dividing the transformation space into distinct algebraic properties, the system can handle complexity systematically through rule-based processing rather than monolithic analysis

Inventive Principle:
Principle #1Segmentation

Data Source

PatentUS20260010354A1Compiler Transformations for Expression Reuse
Publication Date: 2026.01.08 ADVANCED MICRO DEVICES INC
  • US20260010354A1 patent drawing
  • US20260010354A1 patent drawing
  • US20260010354A1 patent drawing

AI summary

Compiler transformations for expression reuse are described. In accordance with the described techniques, a system includes a processor and a compiler executing on the processor. The compiler causes the processor to generate an intermediate representation of a program instruction, transform the intermediate expression, and generate executable code of the program instruction from the transformed intermediate representation. As a part of the transforming, the compiler causes the processor to generate equivalent expressions of a program expression of the intermediate representation, select a lowest cost expression of the equivalent expressions and the program expression based on a set of reusable expressions, and replace the program expression with the lowest cost expression.