A simple graph-based intermediate representation

  • Authors:
  • Cliff Click;Michael Paleczny

  • Affiliations:
  • Cambridge Research Office, Hewlett Packard Laboratories, One Main Street, 10th Floor, Cambridge, MA;Paleczny, Rice University, CITI/CRPC - MS 41, 6100 South Main, Houston, TX

  • Venue:
  • IR '95 Papers from the 1995 ACM SIGPLAN workshop on Intermediate representations
  • Year:
  • 1995

Quantified Score

Hi-index 0.00

Visualization

Abstract

We present a graph-based intermediate representation (IR) with simple semantics and a low-memory-cost C++ implementation. The IR uses a directed graph with labeled vertices and ordered inputs but unordered outputs. Vertices are labeled with opcodes, edges are unlabeled. We represent the CFG and basic blocks with the same vertex and edge structures. Each opcode is defined by a C++ class that encapsulates opcode-specific data and behavior. We use inheritance to abstract common opcode behavior, allowing new opcodes to be easily defined from old ones. The resulting IR is simple, fast and easy to use.