summaryrefslogtreecommitdiff
path: root/src/passes/Vacuum.cpp
diff options
context:
space:
mode:
authorAlon Zakai <azakai@google.com>2022-09-16 14:11:25 -0700
committerGitHub <noreply@github.com>2022-09-16 21:11:25 +0000
commit4e24fdfd74347dc40ba32efee6b154e6ec9827c0 (patch)
tree42413adab127314c4b0bd5035db4aae55359ff08 /src/passes/Vacuum.cpp
parent241dee74dd8e58e166a4aa64c15e0f71ed1819bf (diff)
downloadbinaryen-4e24fdfd74347dc40ba32efee6b154e6ec9827c0.tar.gz
binaryen-4e24fdfd74347dc40ba32efee6b154e6ec9827c0.tar.bz2
binaryen-4e24fdfd74347dc40ba32efee6b154e6ec9827c0.zip
Effects: Clarify trap effect meaning, and consider infinite loops to trap due to timeout (#5039)
I think this simplifies the logic behind what we consider to trap. Before we had kind of a hack in visitLoop that now has a more clear reasoning behind it: we consider as trapping things that trap in all VMs all the time, or will eventually. So a single allocation doesn't trap, but an unbounded amount can, and an infinite loop is considered to trap as well (a timeout in a VM will be hit eventually, somehow). This means we cannot optimize way a trivial infinite loop with no effects in it, while (1) {} But we can optimize it out in trapsNeverHappen mode. In any event, such a loop is not a realistic situation; an infinite loop with some other effect in it, like a call to an import, will not be optimized out, of course. Also clarify some other things regarding traps and trapsNeverHappen following recent discussions in https://github.com/emscripten-core/emscripten/issues/17732 Specifically, TNH will never be allowed to remove calls to imports.
Diffstat (limited to 'src/passes/Vacuum.cpp')
0 files changed, 0 insertions, 0 deletions