summaryrefslogtreecommitdiff
path: root/src/passes/SignaturePruning.cpp
diff options
context:
space:
mode:
authorAlon Zakai <azakai@google.com>2023-03-31 11:31:16 -0700
committerGitHub <noreply@github.com>2023-03-31 18:31:16 +0000
commit2a70c822d87cf114a4de893bf726578660d30275 (patch)
treebc73e03ac08afa9fba9d474249a88144d583891e /src/passes/SignaturePruning.cpp
parentc06593b41242ca1f58da47806dbf5ccb3f2100f4 (diff)
downloadbinaryen-2a70c822d87cf114a4de893bf726578660d30275.tar.gz
binaryen-2a70c822d87cf114a4de893bf726578660d30275.tar.bz2
binaryen-2a70c822d87cf114a4de893bf726578660d30275.zip
Add a TODO in SignaturePruning (#5611)
Diffstat (limited to 'src/passes/SignaturePruning.cpp')
-rw-r--r--src/passes/SignaturePruning.cpp8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/passes/SignaturePruning.cpp b/src/passes/SignaturePruning.cpp
index cd3f4abf6..dd6d278d1 100644
--- a/src/passes/SignaturePruning.cpp
+++ b/src/passes/SignaturePruning.cpp
@@ -163,6 +163,14 @@ struct SignaturePruning : public Pass {
SubTypes subTypes(*module);
// Find parameters to prune.
+ //
+ // TODO: The order matters here, and more than one cycle can find more work
+ // in some cases, as finding a parameter is a constant and removing it
+ // can lead to another call (that receives that parameter's value) to
+ // now have constant parameters as well, and so it becomes
+ // optimizable. We could do a topological sort or greatest fixed point
+ // analysis to be optimal (that could handle a recursive call with a
+ // constant).
for (auto& [type, funcs] : sigFuncs) {
auto sig = type.getSignature();
auto& info = allInfo[type];