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

Store FramePointer in the IR and cache it #10129

Closed
4 tasks
JaroslavTulach opened this issue May 29, 2024 · 8 comments · Fixed by #10729
Closed
4 tasks

Store FramePointer in the IR and cache it #10129

JaroslavTulach opened this issue May 29, 2024 · 8 comments · Fixed by #10729

Comments

@JaroslavTulach
Copy link
Member

This inquiry is inspired by this IrToTruffle code. First of all it, takes Occurance from the IR:

          val useInfo = name
            .unsafeGetMetadata(
              AliasAnalysis,
              "No occurrence on variable usage."
            )
            .unsafeAs[AliasInfo.Occurrence]

          val framePointer = scope.getFramePointer(useInfo.id)

and it converts it into FramePointer to do that it needs a scope also coming from the IR (some parent). The conversion of Occurence via LocalScope is non-trivial as observed by

However, we don't have to do it at all! All we need is the FramePointer (a pair of integers), we don't need all the scopes & co. As such:

Let's compute FramePointer onces, before generating caches and then just load it.

Tasks

@hubertp
Copy link
Contributor

hubertp commented Jul 10, 2024

Could potentially eliminate a lot of deserialization that is currently done for AliasAnalysis, e.g.
Screenshot from 2024-07-10 20-36-49

@enso-bot
Copy link

enso-bot bot commented Aug 1, 2024

Pavel Marek reports a new STANDUP for today (2024-08-01):

Progress: - Finished with first batch of tests

  • The new FramePointerAnalysis pass is closely tight to the AliasAnalysis pass.
    • It tries to attach FramePointer as metadata to all the relevant occurences gathered from AliasAnalysis. It should be finished by 2024-08-13.

@enso-bot
Copy link

enso-bot bot commented Aug 2, 2024

Pavel Marek reports a new STANDUP for yesterday (2024-08-01):

Progress: - Fixing tests

@enso-bot
Copy link

enso-bot bot commented Aug 6, 2024

Pavel Marek reports a new STANDUP for today (2024-08-06):

Progress: - Fixing more tests: making sure the metadata is attached to all synthetic variables and arguments.

  • Do not make unnecessary copies of the IR. It should be finished by 2024-08-13.

@enso-bot
Copy link

enso-bot bot commented Aug 7, 2024

Pavel Marek reports a new STANDUP for today (2024-08-07):

Progress: - Merged the warnings speedup PR #10555

  • Discussions, meetings
  • Ensure FramePointerAnalysis traverses case expressions It should be finished by 2024-08-13.

@enso-bot
Copy link

enso-bot bot commented Aug 12, 2024

Pavel Marek reports a new STANDUP for today (2024-08-12):

Progress: - Catching up with emails and reviews.

@enso-bot
Copy link

enso-bot bot commented Aug 13, 2024

Pavel Marek reports a new STANDUP for today (2024-08-13):

Progress: - Fix rest of the test

  • Put various temporary assertions that the new frame pointer metadata is correct.
    • So far, only use the old algorithm, and just print a custom error message if thing are wrong.
    • Everything seems fine, tomorrow, I will migrate to the new metadata. It should be finished by 2024-08-13.

@enso-bot
Copy link

enso-bot bot commented Aug 14, 2024

Pavel Marek reports a new STANDUP for today (2024-08-14):

Progress: - In IrToTruffle, replaced all the usages of AliasAnalysis metadata with FramePointer metadata.

  • I still need to think about how to minimalize LocalScope.
    • It contains references to Alias graph, which is huge and causes performance overhead when deserialized.
    • Theoretically, IRToTruffle does not need these references, but they are used later in different places.
    • I will probably leave this for a follow-up PR. It should be finished by 2024-08-16.

@github-project-automation github-project-automation bot moved this from 🔧 Implementation to 🟢 Accepted in Issues Board Aug 16, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Archived in project
Development

Successfully merging a pull request may close this issue.

3 participants