We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent b3570ab commit c730be1Copy full SHA for c730be1
src/ir/effects.h
@@ -417,9 +417,11 @@ class EffectAnalyzer {
417
assert(!((trap && other.throws()) || (throws() && other.trap)));
418
// We can't reorder an implicit trap in a way that could alter what global
419
// state is modified.
420
- if ((trap && other.writesGlobalState()) ||
421
- (other.trap && writesGlobalState())) {
422
- return true;
+ if (transfersControlFlow() || other.transfersControlFlow()) {
+ if ((trap && other.writesGlobalState()) ||
+ (other.trap && writesGlobalState())) {
423
+ return true;
424
+ }
425
}
426
return false;
427
0 commit comments