Skip to content

Minor update to IR Statistics#593

Merged
janniclas merged 1 commit intodevelopmentfrom
f-statistics
Feb 25, 2023
Merged

Minor update to IR Statistics#593
janniclas merged 1 commit intodevelopmentfrom
f-statistics

Conversation

@janniclas
Copy link
Copy Markdown
Member

Including a counter for global constants (seems like u were right @fabianbs96 , most of the globals generated in Swift-based LLVM IR are consts and can be ignored for most cases :) )

Copy link
Copy Markdown
Member

@fabianbs96 fabianbs96 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm, except minor

<< "Functions:\t" << Statistics.Functions << "\n"
<< "Global Variables:\t" << Statistics.Globals << "\n"
<< "Global Variable Consts:\t" << Statistics.GlobalConsts << "\n"
<< "Global Pointers:\t" << Statistics.GlobalPointers << "\n"
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This seems to be redundant. All globals are of pointer type by construction

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

agreed. however, the code to set these counters where here before and I didn't want to remove it because I was not sure if someone uses it with exactly this output.

    if (Global.getType()->isPointerTy()) {
      ++Stats.GlobalPointers;
    }
    ++Stats.Globals;

We can definitely remove this but I didn't want to sneak it in here to keep it clear, I just added it to the output to make it more transparent that this exists.

@janniclas janniclas merged commit e6b8e7f into development Feb 25, 2023
@janniclas janniclas deleted the f-statistics branch February 25, 2023 11:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants