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

ComputeWriteSet does not properly maintain the calling context #4811

Open
kfcripps opened this issue Jul 16, 2024 · 1 comment
Open

ComputeWriteSet does not properly maintain the calling context #4811

kfcripps opened this issue Jul 16, 2024 · 1 comment
Assignees
Labels
bug This behavior is unintended and should be fixed. core Topics concerning the core segments of the compiler (frontend, midend, parser)

Comments

@kfcripps
Copy link
Contributor

kfcripps commented Jul 16, 2024

See #4810 and related discussions for context.

Consider an IR::SwitchStatement that has two unique IR::SwitchCases (let's call them "case 1 and 2"), that each point to the same IR::BlockStatement*.

When traversing from preorder(const IR::SwitchStatement *statement) down to preorder(const IR::BlockStatement *statement), the callingContext is not updated, so when we are setting the IR::BlockStatement*'s definitions, the ProgramPoint for the IR::BlockStatement* pointed by both case 1 and case 2 will be equivalent.

This is just one example of the problem, but there are also at least several other (and possibly many other) places in ComputeWriteSet where this is a problem.

Solving this problem should allow us to disable the Cloner and RemoveHidden passes, as suggested by @mihaibudiu in #4797.

#4810 (comment) mentions two possible solutions for the problem.

To better understand the problem:

  1. Checkout changes from Do not recompute write sets for equal child nodes belonging to a given IR::Vector #4810 (comment)
  2. Disable Cloner and RemoveHidden passes, run unit tests, and analyze the failures
@kfcripps kfcripps added bug This behavior is unintended and should be fixed. core Topics concerning the core segments of the compiler (frontend, midend, parser) labels Jul 16, 2024
@kfcripps
Copy link
Contributor Author

We should also consider reverting #4727 after this has been fully fixed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug This behavior is unintended and should be fixed. core Topics concerning the core segments of the compiler (frontend, midend, parser)
Projects
None yet
Development

No branches or pull requests

4 participants