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
[RFC] Fix pure-ness check #2861
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think the immediate patch would be just to remove m_doShort.
There's a great deal of work to do to support true short-circuiting, so don't think this smaller patch just looking at improving isTPure by itself is worth doing without hitting the larger issues. If you'd like to take on short circuiting generally that would be awesome, we should discuss in #487.
Unfortunately just ignoring m_doShort is not sufficient. There are several test failures other than statistic mismatch, such as: It seems there are some optimizations that the latter pass requires. I will look for minimal change. |
My experiment shows the following check is minimal to pass the existing tests. Note that I am not saying that I want to merge the check to master. Lines 916 to 929 in b891dab
These changes are necessary to get correct simulation result. (ShiftL with excessive shift amount has to be removed because it is undefined behavior in C++). Checks in b891dab do not guarantee to show correct result for any design. Current istPure() that always returns true looks to give correct simulation result in general. I am feeling to just add test (629e064) marked fail for now. |
Hmm. I think the newer code is closer to the right path, but agree marking the test fail for now is probably the safest path until we have time to think this out completely. |
I'd like to close this PR for now. Hopefully I will tackle again. |
While I am writing a small RTL to improve code coverage (#2824), I found that any node is considered "pure" because m_doShort is always true.
I guess the original intention is like 31aa715.
Unfortunately I found some tests fail after the change.
The former one is predicted, but the other two are not acceptable.
Should I add recursive pure-ness check ? ( Not so difficult, but not sure for its cost).
Adding rough check (11c4361) fixes tests.
The visitor is not perfetct.