summaryrefslogtreecommitdiff
path: root/src/ast/cost.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/ast/cost.h')
-rw-r--r--src/ast/cost.h10
1 files changed, 8 insertions, 2 deletions
diff --git a/src/ast/cost.h b/src/ast/cost.h
index 151468650..56050b189 100644
--- a/src/ast/cost.h
+++ b/src/ast/cost.h
@@ -78,10 +78,16 @@ struct CostAnalyzer : public Visitor<CostAnalyzer, Index> {
return 2;
}
Index visitLoad(Load *curr) {
- return 1 + visit(curr->ptr);
+ return 1 + visit(curr->ptr) + 10 * curr->isAtomic;
}
Index visitStore(Store *curr) {
- return 2 + visit(curr->ptr) + visit(curr->value);
+ return 2 + visit(curr->ptr) + visit(curr->value) + 10 * curr->isAtomic;
+ }
+ Index visitAtomicRMW(AtomicRMW *curr) {
+ return 100;
+ }
+ Index visitAtomicCmpxchg(AtomicCmpxchg* curr) {
+ return 100;
}
Index visitConst(Const *curr) {
return 1;