Skip to content

Commit 0cd2184

Browse files
eigen-kfacebook-github-bot
authored andcommitted
Move remove passes to iterative section
Summary: This change reorganizes the pass execution order by moving the remove passes (clone removal, permute removal, etc.) into the iterative section of the pass manager. Previously, these passes were executed in a single-shot manner. By moving them to the iterative section, the pass manager can now run these optimization passes repeatedly until a fixed point is reached, where no further optimizations can be applied. This is important because removing one operation may enable additional removal opportunities that weren't visible before. Differential Revision: D88109852
1 parent c415633 commit 0cd2184

File tree

1 file changed

+1
-7
lines changed

1 file changed

+1
-7
lines changed

backends/cadence/aot/remove_ops.py

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -913,7 +913,7 @@ def maybe_remove_or_replace(self, node: Node) -> bool:
913913
return False
914914

915915

916-
class CommonRemovePasses:
916+
class CadenceRemoveNops:
917917
passes: List[Type[ExportPass]] = [
918918
RemoveAliasCopyOpPass,
919919
RemoveNopExpandOpPass,
@@ -924,12 +924,6 @@ class CommonRemovePasses:
924924
RemoveSqueezeViewBeforeElementwiseOps,
925925
RemoveCatFromSliceCopyPass,
926926
RemoveCloneOpsTransformImported,
927-
]
928-
929-
930-
class CadenceRemoveNops:
931-
passes: List[Type[ExportPass]] = CommonRemovePasses.passes + [
932-
SimplifySliceOpPass,
933927
RemoveNopRequantizeOpPass,
934928
RemoveZeroSizedConstantPadNd,
935929
RemoveContiguousOpPass,

0 commit comments

Comments
 (0)