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

Unused Registers #207

Closed
DavePearce opened this issue Jun 19, 2024 · 1 comment
Closed

Unused Registers #207

DavePearce opened this issue Jun 19, 2024 · 1 comment
Labels
bug Something isn't working

Comments

@DavePearce
Copy link
Collaborator

Minimal example for reproduction:

(module m1)
(defcolumns A B C D)
(deflookup test1 ((+ 1 A) B) (C D))
(deflookup test2 ((+ 1 A)) (C))
(deflookup test3 (A) ((+ 1 C)))

Run with corset debug -Ceeee test.lisp gives this output:

  ID Name                   Type   ×  Reg.
   3 m1.A                      𝔽   1  r0/m1.Aι1
   0 m1.B                      𝔽   1  r1/m1.Bι1
   2 m1.C                      𝔽   1  r2/m1.Cι1
   1 m1.D                      𝔽   1  r3/m1.Dι1
   4 m1.C/#EXPAND[(+ 1 A)]     𝔽   1  r4/m1.C/#EXPAND[(+ 1 A)]ι1
   5 m1.C/#EXPAND[(+ 1 C)]     𝔽   1  r6/m1.C/#EXPAND[(+ 1 C)]ι1   

Here, we can see 5 columns listed. What is less obvious, however, is that there are in fact 6 registers in the list. We can see that r5 is not listed above and, in fact, is a duplicate of m1.C/#EXPAND[(+ 1 A)]. This seems unexpected to me, and suggests a bug in the register allocation mechanism. It also seems that corset is currently working around this.

@DavePearce DavePearce added the bug Something isn't working label Jun 19, 2024
DavePearce added a commit that referenced this issue Jun 19, 2024
This puts in place a fix for duplicate registers being added during
expression expansion.  Its not clear whether there are any other places
where this can happen, but none are being triggered on our (largish)
example.
DavePearce added a commit that referenced this issue Jun 20, 2024
This puts in place a fix for duplicate registers being added during
expression expansion.  Its not clear whether there are any other places
where this can happen, but none are being triggered on our (largish)
example.
@DavePearce
Copy link
Collaborator Author

Ok, have managed to put in a fix for this which addresses the example above. There maybe other situations where this could arise --- I didn't check. But they weren't flagged building our large example.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant