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

Improve IR support for structs #19

Open
1 of 2 tasks
dubiousconst282 opened this issue Mar 8, 2023 · 0 comments
Open
1 of 2 tasks

Improve IR support for structs #19

dubiousconst282 opened this issue Mar 8, 2023 · 0 comments

Comments

@dubiousconst282
Copy link
Owner

dubiousconst282 commented Mar 8, 2023

Structs are currently almost always keept in exposed local variable slots, making it difficult for transforms to check for legality since there's almost no data-flow info.

TODOs:

  • Consider making Variables always "semi-exposed", so that they always provide a symbolic byref/pointer.
    • Removes the need for Var Load/Store/Addr instructions
    • Problem: would require the instantiation of a ByrefType for every type instance in a local var.
  • Implement some kind of analysis like Memory SSA
    • Maintaining a parallel IR may be a bit inconvenient given the current infra. We may want instead to consider some hybrid with scalar SSA and the exposed flag to match heap objects, so that we can make assumptions like "Span<T> instances being always read-only".
      A problem with this hybrid is that we'd still need some way to take the SSA address when calling instance methods/field accesses, and if we're not careful this could bring more issues than it'd solve (consider inlining something like void M() { this = default; }).
dubiousconst282 added a commit that referenced this issue Mar 9, 2023
Work towards unifying load/store instructions.
Variable access insts are still to be removed, see #19
dubiousconst282 added a commit that referenced this issue Mar 20, 2023
Make `LocalSlot` (previously `Variable`) as a memory location rather than an opaque value.

This allows it to be used seamlessly with LoadInst and StoreInst, and removes the need for VarAddrInst.

Contributes to #19
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

No branches or pull requests

1 participant