summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorMax Graey <maxgraey@gmail.com>2021-10-14 02:44:56 +0300
committerGitHub <noreply@github.com>2021-10-13 16:44:56 -0700
commitbf4b4b2012992a5e8f59359d0dd6c89df1993cca (patch)
tree3b1cfec40511739f7e37f12a8fa285d8bd13c3a6 /src
parentc1031ad28382adc240d2d9198e3a2e3ccaccbb3a (diff)
downloadbinaryen-bf4b4b2012992a5e8f59359d0dd6c89df1993cca.tar.gz
binaryen-bf4b4b2012992a5e8f59359d0dd6c89df1993cca.tar.bz2
binaryen-bf4b4b2012992a5e8f59359d0dd6c89df1993cca.zip
[Selectify] Increase TooCostlyToRunUnconditionally from 7 to 9 (#4228)
This makes Binaryen match LLVM on a real-world case, which is probably the safest heuristic to use.
Diffstat (limited to 'src')
-rw-r--r--src/passes/RemoveUnusedBrs.cpp5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/passes/RemoveUnusedBrs.cpp b/src/passes/RemoveUnusedBrs.cpp
index cbad81247..01c465f18 100644
--- a/src/passes/RemoveUnusedBrs.cpp
+++ b/src/passes/RemoveUnusedBrs.cpp
@@ -80,7 +80,10 @@ static bool canTurnIfIntoBrIf(Expression* ifCondition,
return !EffectAnalyzer(options, wasm, ifCondition).invalidates(value);
}
-const Index TooCostlyToRunUnconditionally = 7;
+// This leads to similar choices as LLVM does.
+// See https://github.com/WebAssembly/binaryen/pull/4228
+// It can be tuned more later.
+const Index TooCostlyToRunUnconditionally = 9;
// Check if it is not worth it to run code unconditionally. This
// assumes we are trying to run two expressions where previously