From 7b290a22e9d80968adc01c9625587caaada6368a Mon Sep 17 00:00:00 2001 From: Andrew Pullin Date: Tue, 25 Aug 2026 14:15:06 -0700 Subject: [PATCH] Drop redundant recompiles before ARM pass retracing Summary: Drop redundant recompile() before ARM pass retracing. Remove redundant GraphModule.recompile() calls immediately before super().call(graph_module) in CanonicalizeViewCopyPermutePass and FuseDuplicateUsersPass. The following ExportPass retrace/interpreter does not consume compiled Python code object, so recompile adds wall time without changing graph. Keep graph.lint() in modified paths for invariant checking. Behavior-preserving lowering speedup. Differential Revision: D114790155 --- backends/arm/_passes/canonicalize_view_copy_permute_pass.py | 2 +- backends/arm/_passes/fuse_duplicate_users_pass.py | 1 - 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/backends/arm/_passes/canonicalize_view_copy_permute_pass.py b/backends/arm/_passes/canonicalize_view_copy_permute_pass.py index 6c93b036f02..62ebd2d4320 100644 --- a/backends/arm/_passes/canonicalize_view_copy_permute_pass.py +++ b/backends/arm/_passes/canonicalize_view_copy_permute_pass.py @@ -82,7 +82,7 @@ def call(self, graph_module: GraphModule) -> PassResult: if modified: graph_module.graph.eliminate_dead_code() - graph_module.recompile() + graph_module.graph.lint() graph_module = super().call(graph_module).graph_module return PassResult(graph_module, modified) diff --git a/backends/arm/_passes/fuse_duplicate_users_pass.py b/backends/arm/_passes/fuse_duplicate_users_pass.py index 9bd21112569..9134f361acf 100644 --- a/backends/arm/_passes/fuse_duplicate_users_pass.py +++ b/backends/arm/_passes/fuse_duplicate_users_pass.py @@ -88,7 +88,6 @@ def call(self, graph_module: GraphModule) -> PassResult: producers.append(representative) if modified: - graph_module.recompile() graph_module.graph.lint() graph_module = super().call(graph_module).graph_module