diff --git a/src/passes/OptimizeInstructions.cpp b/src/passes/OptimizeInstructions.cpp index 47964f33713..70d850f5133 100644 --- a/src/passes/OptimizeInstructions.cpp +++ b/src/passes/OptimizeInstructions.cpp @@ -1581,7 +1581,7 @@ struct OptimizeInstructions // trap we want to move. (We use a shallow effect analyzer since we // will only move the ref.as_non_null itself.) ShallowEffectAnalyzer movingEffects(options, *getModule(), input); - if (crossedEffects.invalidates(movingEffects)) { + if (movingEffects.orderedBefore(crossedEffects)) { return; } @@ -2574,7 +2574,7 @@ struct OptimizeInstructions auto& options = getPassRunner()->options; EffectAnalyzer descEffects(options, *getModule(), curr->desc); ShallowEffectAnalyzer movingEffects(options, *getModule(), curr->ref); - if (descEffects.invalidates(movingEffects)) { + if (movingEffects.orderedBefore(descEffects)) { return; } }