summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/ir/effects.h7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/ir/effects.h b/src/ir/effects.h
index 8c95f463d..394bf0116 100644
--- a/src/ir/effects.h
+++ b/src/ir/effects.h
@@ -74,9 +74,10 @@ struct EffectAnalyzer : public PostWalker<EffectAnalyzer> {
// 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) {
- if (branches || other.branches
- || ((writesMemory || calls) && other.accessesMemory())
- || (accessesMemory() && (other.writesMemory || other.calls))) {
+ if ((branches && other.hasSideEffects()) ||
+ (other.branches && hasSideEffects()) ||
+ ((writesMemory || calls) && other.accessesMemory()) ||
+ (accessesMemory() && (other.writesMemory || other.calls))) {
return true;
}
// All atomics are sequentially consistent for now, and ordered wrt other