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

Do not version w.r.t. concurrently writable memory #33

Conversation

jdmpapin
Copy link
Contributor

Versioner currently treats loads of fields and statics as loop-invariant (when the loop doesn't explicitly write them) and generates versioning tests containing such loads. If another thread writes to a field or static, it's possible for the value observed by the loop body to differ from the value observed in a versioning test. For a load that has been copied into multiple versioning tests, it is even possible to see values that are inconsistent between versioning tests. In particular, after running a versioning test, the property it tests for may no longer hold of the value obtained by repeating the load, so it is incorrect to skip checks.

In the absence of synchronization and calls it is possible to version based on expressions containing such loads by privatizing their values, guaranteeing that the values remain stable throughout the series of versioning tests and the hot loop body. However, doing so is a very large change.

For now, treat any node that would need to be privatized as non-invariant to prevent incorrect versioning.

The upstream OMR PR eclipse-omr/omr#4138 has been merged. The parent of that commit was too new, so here the change has been rebased onto v0.15.0-release.

Versioner currently treats loads of fields and statics as loop-invariant
(when the loop doesn't explicitly write them) and generates versioning
tests containing such loads. If another thread writes to a field or
static, it's possible for the value observed by the loop body to differ
from the value observed in a versioning test. For a load that has been
copied into multiple versioning tests, it is even possible to see values
that are inconsistent between versioning tests. In particular, after
running a versioning test, the property it tests for may no longer hold
of the value obtained by repeating the load, so it is incorrect to skip
checks.

In the absence of synchronization and calls it is possible to version
based on expressions containing such loads by privatizing their values,
guaranteeing that the values remain stable throughout the series of
versioning tests and the hot loop body. However, doing so is a very
large change.

For now, treat any node that would need to be privatized as
non-invariant to prevent incorrect versioning.

Signed-off-by: Devin Papineau <devinmp@ca.ibm.com>
@pshipton pshipton merged commit ec782f2 into eclipse-openj9:v0.15.0-release Jul 17, 2019
@jdmpapin jdmpapin deleted the versioner-no-concurrent-v0.15.0 branch October 15, 2021 01:02
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

Successfully merging this pull request may close these issues.

2 participants