Skip to content

Graph Improvement: GlobalAllocs #83

@dkcumming

Description

@dkcumming

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;
    }
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions