SSA-IR Compiler Structure Preservation for Acausal Models
Find Innovative SolutionsGenerate Solutions
Solution Overview
Problem
Existing compiler systems for acausal modeling struggle with the runtime efficiency of generated code and the scaling of the compilation and code-generation process, often requiring loss of structure or flattening of differential-algebraic equations (DAE) systems to perform compilation, which leads to performance losses.
Innovation Solution
The proposed compiler systems and methods retain structure by using programming language intermediate representations, specifically extending the Pantelides algorithm, alias elimination, and tearing algorithms to SSA-IR, enabling efficient code generation and runtime performance for large-scale acausal models through bottom-up automatic differentiation and outlining passes.
Engineering Contradictions & Design Principles
Engineering Contradiction Analysis
1Stability of the object's composition
If single-static assignment intermediate representation (SSA-IR) is used to represent a Modelica compiler, then structure preservation is achieved, but standard compilation passes (alias elimination, index reduction, tearing, and code generation) cannot be performed
Solution Approach 1:
The patent uses SSA-IR as an intermediary representation that bridges the gap between preserving model structure and enabling standard compilation passes. By extending SSA-IR with specific capabilities, it mediates between the conflicting requirements of structure preservation and compilation effectiveness.
Solution Approach 2:
The patent modifies SSA-IR by extending it with additional parameters and capabilities specifically tailored for acausal modeling compilation. This includes adding support for alias elimination, index reduction, and tearing operations directly within the SSA-IR framework, thereby changing the representation's parameters to enable both structure preservation and standard compilation passes.
2Productivity
If code generation is performed without structure preservation, then compilation speed is improved, but runtime performance of generated code deteriorates
Solution Approach 1:
The patent performs structure-preserving transformations and optimizations during the compilation phase using extended SSA-IR, preparing the code in advance to ensure both fast generation and efficient runtime execution. The outlining passes and alias elimination are performed preliminarily to maintain structure while enabling efficient code generation.
Data Source
AI summary
Compiler systems and methods are described herein that retain structure to scale acausal models into large-scale models. They provide extensions to the algorithms and compiler to achieve both structure preservation and core passes of a stable acausal modeling compiler (alias elimination, index reduction, tearing, and code generation). Structure preservation is provided through programming language intermediate representations. A SSA-IR representation of the model is received, incidence information is computed via taint analysis, the Pantelides algorithm is extended to SSA-IR via bottom-up AD, alias elimination is extended to SSA-IR, tearing is extended to SSA-IR, and structure is regained through outlining passes on SSA-IR. Benefits of increasing speed and efficiency of code generation are provided.


