-
Notifications
You must be signed in to change notification settings - Fork 15
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
Memory carried dependencies cannot be detected #42
Comments
I don't think this is an easy problem to solve within the confines of OSACA. Unlike register dependencies, memory deps are data dependent. Since you do static analysis of a loop w/o knowing the inputs, I think the best you can hope for is to prove that some loads must alias previous stores, but this isn't sufficient, you could have other store-load pairs that alias depending on the inputs, or sometimes alias, etc, e.g.:
Depending on the initial values of So I don't think you can hope to solve this problem in general. Perhaps you could allow the user to annotate which loads are known to depend on which stores, which would allow much better analysis if the user understood the aliasing relationships. |
Consider the following loop:
I imagine OSACA will report it has having no loop carried dependencies. However, the actual iteration time of such a loop is 4-6 cycles, since there is a dependency through the memory location
[rdx]
, which isn't detected by OSACA which only knows about register dependencies (I think).Obviously, real world examples are more complicated, but the basic idea is the same: some subsequent iteration (not necessarily exactly the succeeding one, it could be later) may read a value from memory written by a the same or a previous iteration, forming a dependency.
The text was updated successfully, but these errors were encountered: