Skip to content

Commit b762ac7

Browse files
eigen-kfacebook-github-bot
authored andcommitted
Move remove passes to iterative section (#16049)
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. Reviewed By: hsharma35 Differential Revision: D88109852
1 parent e42ea3c commit b762ac7

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
@@ -909,7 +909,7 @@ def maybe_remove_or_replace(self, node: Node) -> bool:
909909
return False
910910

911911

912-
class CommonRemovePasses:
912+
class CadenceRemoveNops:
913913
passes: List[Type[ExportPass]] = [
914914
RemoveAliasCopyOpPass,
915915
RemoveNopExpandOpPass,
@@ -920,12 +920,6 @@ class CommonRemovePasses:
920920
RemoveSqueezeViewBeforeElementwiseOps,
921921
RemoveCatFromSliceCopyPass,
922922
RemoveCloneOpsTransformImported,
923-
]
924-
925-
926-
class CadenceRemoveNops:
927-
passes: List[Type[ExportPass]] = CommonRemovePasses.passes + [
928-
SimplifySliceOpPass,
929923
RemoveNopRequantizeOpPass,
930924
RemoveZeroSizedConstantPadNd,
931925
RemoveContiguousOpPass,

0 commit comments

Comments
 (0)