Skip to content

Commit a11b7a4

Browse files
authored
retrieve cadence_passes in apply_jarvis_passes
Differential Revision: D72999266 Pull Request resolved: #10245
1 parent 1afb25e commit a11b7a4

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

backends/cadence/aot/pass_utils.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -35,8 +35,8 @@ class CadencePassAttribute:
3535
ALL_CADENCE_PASSES: dict[ExportPass, CadencePassAttribute] = {}
3636

3737

38-
def get_cadence_pass_attribute(p: ExportPass) -> CadencePassAttribute:
39-
return ALL_CADENCE_PASSES[p]
38+
def get_cadence_pass_attribute(p: ExportPass) -> Optional[CadencePassAttribute]:
39+
return ALL_CADENCE_PASSES.get(p, None)
4040

4141

4242
# A decorator that registers a pass.
@@ -61,7 +61,8 @@ def create_cadence_pass_filter(
6161
def _filter(p: ExportPass) -> bool:
6262
pass_attribute = get_cadence_pass_attribute(p)
6363
return (
64-
pass_attribute.opt_level is not None
64+
pass_attribute is not None
65+
and pass_attribute.opt_level is not None
6566
and pass_attribute.opt_level <= opt_level
6667
and (not pass_attribute.debug_pass or debug)
6768
)

0 commit comments

Comments
 (0)