Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
P
pairs
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
software
pairs
Commits
85827040
Commit
85827040
authored
5 months ago
by
Behzad Safaei
Browse files
Options
Downloads
Patches
Plain Diff
Force write-after-read for AtomicInc nodes
parent
8ba950c9
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/pairs/analysis/modules.py
+8
-0
8 additions, 0 deletions
src/pairs/analysis/modules.py
src/pairs/transformations/expressions.py
+0
-12
0 additions, 12 deletions
src/pairs/transformations/expressions.py
with
8 additions
and
12 deletions
src/pairs/analysis/modules.py
+
8
−
0
View file @
85827040
...
@@ -39,8 +39,16 @@ class FetchModulesReferences(Visitor):
...
@@ -39,8 +39,16 @@ class FetchModulesReferences(Visitor):
self
.
visit
(
ast_node
.
capacity
)
self
.
visit
(
ast_node
.
capacity
)
def
visit_AtomicInc
(
self
,
ast_node
):
def
visit_AtomicInc
(
self
,
ast_node
):
visit_once
=
self
.
visit_nodes_once
self
.
visit_nodes_once
=
False
# Force write after read for the same node (visited twice)
self
.
writing
=
False
self
.
visit
(
ast_node
.
elem
)
self
.
writing
=
True
self
.
writing
=
True
self
.
visit
(
ast_node
.
elem
)
self
.
visit
(
ast_node
.
elem
)
self
.
visit_nodes_once
=
visit_once
self
.
writing
=
False
self
.
writing
=
False
self
.
visit
(
ast_node
.
value
)
self
.
visit
(
ast_node
.
value
)
...
...
This diff is collapsed.
Click to expand it.
src/pairs/transformations/expressions.py
+
0
−
12
View file @
85827040
...
@@ -194,18 +194,6 @@ class AddExpressionDeclarations(Mutator):
...
@@ -194,18 +194,6 @@ class AddExpressionDeclarations(Mutator):
return
ast_node
return
ast_node
def
mutate_AtomicInc
(
self
,
ast_node
):
self
.
writing
=
True
ast_node
.
elem
=
self
.
mutate
(
ast_node
.
elem
)
self
.
writing
=
False
ast_node
.
value
=
self
.
mutate
(
ast_node
.
value
)
atomic_inc_id
=
id
(
ast_node
)
if
atomic_inc_id
not
in
self
.
declared_exprs
and
atomic_inc_id
not
in
self
.
params
:
self
.
push_decl
(
Decl
(
ast_node
.
sim
,
ast_node
))
self
.
declared_exprs
.
append
(
atomic_inc_id
)
return
ast_node
def
mutate_Block
(
self
,
ast_node
):
def
mutate_Block
(
self
,
ast_node
):
block_id
=
id
(
ast_node
)
block_id
=
id
(
ast_node
)
self
.
decls
[
block_id
]
=
[]
self
.
decls
[
block_id
]
=
[]
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment