summaryrefslogtreecommitdiff
path: root/src/ir/effects.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/ir/effects.h')
-rw-r--r--src/ir/effects.h14
1 files changed, 7 insertions, 7 deletions
diff --git a/src/ir/effects.h b/src/ir/effects.h
index 1c33964a7..e1fa77af0 100644
--- a/src/ir/effects.h
+++ b/src/ir/effects.h
@@ -59,13 +59,13 @@ struct EffectAnalyzer : public PostWalker<EffectAnalyzer, OverriddenVisitor<Effe
// Helper functions to check for various effect types
- bool accessesLocal() { return localsRead.size() + localsWritten.size() > 0; }
- bool accessesGlobal() { return globalsRead.size() + globalsWritten.size() > 0; }
- bool accessesMemory() { return calls || readsMemory || writesMemory; }
+ bool accessesLocal() const { return localsRead.size() + localsWritten.size() > 0; }
+ bool accessesGlobal() const { return globalsRead.size() + globalsWritten.size() > 0; }
+ bool accessesMemory() const { return calls || readsMemory || writesMemory; }
- bool hasGlobalSideEffects() { return calls || globalsWritten.size() > 0 || writesMemory || isAtomic; }
- bool hasSideEffects() { return hasGlobalSideEffects() || localsWritten.size() > 0 || branches || implicitTrap; }
- bool hasAnything() { return branches || calls || accessesLocal() || readsMemory || writesMemory || accessesGlobal() || implicitTrap || isAtomic; }
+ bool hasGlobalSideEffects() const { return calls || globalsWritten.size() > 0 || writesMemory || isAtomic; }
+ bool hasSideEffects() const { return hasGlobalSideEffects() || localsWritten.size() > 0 || branches || implicitTrap; }
+ bool hasAnything() const { return branches || calls || accessesLocal() || readsMemory || writesMemory || accessesGlobal() || implicitTrap || isAtomic; }
bool noticesGlobalSideEffects() { return calls || readsMemory || isAtomic || globalsRead.size(); }
@@ -73,7 +73,7 @@ struct EffectAnalyzer : public PostWalker<EffectAnalyzer, OverriddenVisitor<Effe
bool hasExternalBreakTargets() { return !breakNames.empty(); }
// checks if these effects would invalidate another set (e.g., if we write, we invalidate someone that reads, they can't be moved past us)
- bool invalidates(EffectAnalyzer& other) {
+ bool invalidates(const EffectAnalyzer& other) {
if ((branches && other.hasSideEffects()) ||
(other.branches && hasSideEffects()) ||
((writesMemory || calls) && other.accessesMemory()) ||