summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-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];