Skip to content

Commit

Permalink
[AMD] Avoid unneeded instruction schedule pass runs (#5832)
Browse files Browse the repository at this point in the history
We only want to run them if an active variant is requested.
  • Loading branch information
antiagainst authored Feb 5, 2025
1 parent ede4406 commit c7924e8
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions third_party/amd/backend/compiler.py
Original file line number Diff line number Diff line change
Expand Up @@ -218,7 +218,8 @@ def make_ttgir(mod, metadata, options):
"equivalent behavior in the past.")
amd.passes.ttgpuir.add_stream_pipeline(pm, options.num_stages, stream_prefetch)
passes.common.add_canonicalizer(pm)
amd.passes.ttgpuir.insert_instruction_sched_hints(pm)
if options.instruction_sched_variant.lower() != "none":
amd.passes.ttgpuir.insert_instruction_sched_hints(pm)
passes.ttgpuir.add_optimize_dot_operands(pm, True)
passes.ttgpuir.add_remove_layout_conversions(pm)
passes.ttgpuir.add_reduce_data_duplication(pm)
Expand Down Expand Up @@ -274,8 +275,9 @@ def make_llir(src, metadata, options):
passes.common.add_canonicalizer(pm)
passes.common.add_cse(pm)
passes.common.add_symbol_dce(pm)
amd.passes.ttgpuir.lower_instruction_sched_hints(pm, options.arch, options.num_stages,
options.instruction_sched_variant)
if options.instruction_sched_variant.lower() != "none":
amd.passes.ttgpuir.lower_instruction_sched_hints(pm, options.arch, options.num_stages,
options.instruction_sched_variant)
if os.environ.get("TRITON_DISABLE_LINE_INFO", "0") == "0":
passes.llvmir.add_di_scope(pm)
amd.passes.ttgpuir.add_builtin_func_to_llvmir(pm, __HIP_FTZ)
Expand Down

0 comments on commit c7924e8

Please sign in to comment.