runtimeverification / runtimeverification/stable-mir-json

Graph Improvement: GlobalAllocs

Open
#83 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

enhancement
Dominant language
Rust
Stars
11
Forks
6
PR merge metrics
No merged PRs in 30d

Description

It would be good to display the mapping of GlobalAllocs in the graph, and perhaps noting which constants are promoted. And noting when a place is referencing a GlobalAlloc in a Statement or Terminator

Currently we don't indicate a promoted at all (the assignment to _3 into second BB is reading a promoted constant):

Image

This is an example of how the MIR pretty printer displays promoteds. I think we can improve upon this, but it does at least make it clear the constant is promoted.

    bb1: {
        _3 = const main::promoted[0];
        //--snip--
    }


const main::promoted[0]: &i32 = {
    let mut _0: &i32;
    let mut _1: i32;
    let mut _2: (i32, bool);

    bb0: {
        _2 = AddWithOverflow(const 3_i32, const 39_i32);
        _1 = move (_2.0: i32);
        _0 = &_1;
        return;
    }
}

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

No files or tests are named. Start by locating the graph rendering entry point and compare its output with the MIR pretty-printer example; done should include GlobalAlloc mappings, promoted constants, and references from Statements or Terminators.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust
Domain
compilers, devtools
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
42/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.