Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Regalloc: liveness annotations #749

Merged
merged 2 commits into from
Mar 26, 2024
Merged

Regalloc: liveness annotations #749

merged 2 commits into from
Mar 26, 2024

Conversation

vbgl
Copy link
Member

@vbgl vbgl commented Mar 12, 2024

This introduces the -pliveness command-line flag to turn on printing of
liveness information during register-allocation. It prints what local
variables are live at any program point and at the end of each function
what variables of the callers are live at call-sites (hence during the
hole execution of the function).

Example result:

fn inc (reg u32 RAX) -> (reg u32) {

  /* "tests/success/common/liveness.jazz", line 2 (2-9) */
  /* Live-in:
   1 word (RAX) */
  /* Live-out:
   1 word (RAX)
   4 flags (OF SF PF ZF) */
  (OF, SF, PF, ZF, RAX) = #INC_32(RAX); /*  */
  return (RAX);
}
/* Maximum register usage for inc:
   1 word
   4 flags
   Live at call sites:  2 words (RDI RSI)  1 word (RDI)
*/

@vbgl vbgl changed the title Regalloc: liveness annotatons Regalloc: liveness annotations Mar 12, 2024
Copy link
Contributor

@bgregoir bgregoir left a comment

Choose a reason for hiding this comment

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

Thank a lot. I have try to use it.
For me there is two main problems:

  • The variable names do not correspond to the one of the source program.
  • I would like also to print variables depending on their type (and maybe the number of variables of each categories)

@vbgl vbgl force-pushed the show-liveness-data branch 2 times, most recently from d908d70 to f0c801e Compare March 12, 2024 10:47
@vbgl vbgl marked this pull request as ready for review March 12, 2024 12:11
fdupress
fdupress previously approved these changes Mar 13, 2024
@vbgl
Copy link
Member Author

vbgl commented Mar 15, 2024

Thanks Benjamin. I’ve cleaned up the history & commit message. I think this is ready.

@vbgl vbgl force-pushed the show-liveness-data branch 2 times, most recently from 70e4da7 to 09da84a Compare March 21, 2024 16:45
@vbgl vbgl marked this pull request as draft March 21, 2024 16:58
@vbgl vbgl marked this pull request as ready for review March 21, 2024 17:11
@vbgl vbgl force-pushed the show-liveness-data branch 2 times, most recently from e6868e0 to eb0a997 Compare March 25, 2024 12:09
vbgl and others added 2 commits March 25, 2024 15:26
This introduces the -pliveness command-line flag to turn on printing of
liveness information during register-allocation. It prints what local
variables are live at any program point and at the end of each function
what variables of the callers are live at call-sites (hence during the
hole execution of the function).

Co-authored-by: Benjamin Grēgoire <Benjamin.Gregoire@inria.fr>
When printing the location of an instruction, do not repeat the file
name (and path) of a caller when it is the same as the one of the
callee.
@eponier
Copy link
Contributor

eponier commented Mar 25, 2024

I'm reviewing.

@vbgl
Copy link
Member Author

vbgl commented Mar 26, 2024

ping @eponier Is there anything wrong?

Copy link
Contributor

@eponier eponier left a comment

Choose a reason for hiding this comment

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

Yes, something is wrong, I'm too slow to review.

@eponier eponier merged commit efacf89 into main Mar 26, 2024
1 check passed
@eponier eponier deleted the show-liveness-data branch March 26, 2024 13:27
@vbgl
Copy link
Member Author

vbgl commented Mar 26, 2024

Дякую!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants