[PATCH] D127666: [AMDGPU] Remove ShouldPreferAnother after switch to postmisched
Austin Kerbow via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Mon Jun 13 08:56:35 PDT 2022
kerbowa created this revision.
kerbowa added reviewers: rampitec, arsenm, vangthao95, jrbyrnes.
Herald added subscribers: kosarev, jsilvanus, hsmhsm, foad, hiraditya, t-tye, tpr, dstuttard, yaxunl, nhaehnle, jvesely, kzhuravl.
Herald added a project: All.
kerbowa requested review of this revision.
Herald added subscribers: llvm-commits, wdng.
Herald added a project: LLVM.
Repository:
rG LLVM Github Monorepo
https://reviews.llvm.org/D127666
Files:
llvm/lib/Target/AMDGPU/GCNHazardRecognizer.cpp
llvm/lib/Target/AMDGPU/GCNHazardRecognizer.h
llvm/test/CodeGen/AMDGPU/sched-prefer-non-mfma.mir
Index: llvm/test/CodeGen/AMDGPU/sched-prefer-non-mfma.mir
===================================================================
--- llvm/test/CodeGen/AMDGPU/sched-prefer-non-mfma.mir
+++ /dev/null
@@ -1,18 +0,0 @@
-# RUN: llc -march=amdgcn -mcpu=gfx908 -run-pass post-RA-sched -amdgpu-disable-power-sched -verify-machineinstrs -o - %s | FileCheck -check-prefix=GCN %s
-
-# GCN-LABEL: name: unrelated_mfma
-# GCN: V_MFMA_F32_32X32X1F32
-# GCN: S_CMP_LG_U32
-# GCN: V_MFMA_F32_32X32X1F32
-
----
-name: unrelated_mfma
-body: |
- bb.0.entry:
- renamable $agpr0_agpr1_agpr2_agpr3_agpr4_agpr5_agpr6_agpr7_agpr8_agpr9_agpr10_agpr11_agpr12_agpr13_agpr14_agpr15_agpr16_agpr17_agpr18_agpr19_agpr20_agpr21_agpr22_agpr23_agpr24_agpr25_agpr26_agpr27_agpr28_agpr29_agpr30_agpr31 = V_MFMA_F32_32X32X1F32_e64 $vgpr67, $vgpr66, $agpr0_agpr1_agpr2_agpr3_agpr4_agpr5_agpr6_agpr7_agpr8_agpr9_agpr10_agpr11_agpr12_agpr13_agpr14_agpr15_agpr16_agpr17_agpr18_agpr19_agpr20_agpr21_agpr22_agpr23_agpr24_agpr25_agpr26_agpr27_agpr28_agpr29_agpr30_agpr31, 0, 0, 0, implicit $mode, implicit $exec
- renamable $agpr32_agpr33_agpr34_agpr35_agpr36_agpr37_agpr38_agpr39_agpr40_agpr41_agpr42_agpr43_agpr44_agpr45_agpr46_agpr47_agpr48_agpr49_agpr50_agpr51_agpr52_agpr53_agpr54_agpr55_agpr56_agpr57_agpr58_agpr59_agpr60_agpr61_agpr62_agpr63 = V_MFMA_F32_32X32X1F32_e64 $vgpr69, $vgpr68, killed $agpr32_agpr33_agpr34_agpr35_agpr36_agpr37_agpr38_agpr39_agpr40_agpr41_agpr42_agpr43_agpr44_agpr45_agpr46_agpr47_agpr48_agpr49_agpr50_agpr51_agpr52_agpr53_agpr54_agpr55_agpr56_agpr57_agpr58_agpr59_agpr60_agpr61_agpr62_agpr63, 0, 0, 0, implicit $mode, implicit $exec
- renamable $sgpr2 = S_ADD_U32 renamable $sgpr2, 4, implicit-def $scc
- renamable $sgpr3 = S_ADDC_U32 renamable $sgpr3, 0, implicit-def dead $scc, implicit killed $scc
- S_CMP_LG_U32 renamable $sgpr2, 64, implicit-def $scc
-
-...
Index: llvm/lib/Target/AMDGPU/GCNHazardRecognizer.h
===================================================================
--- llvm/lib/Target/AMDGPU/GCNHazardRecognizer.h
+++ llvm/lib/Target/AMDGPU/GCNHazardRecognizer.h
@@ -131,7 +131,6 @@
unsigned PreEmitNoopsCommon(MachineInstr *);
void AdvanceCycle() override;
void RecedeCycle() override;
- bool ShouldPreferAnother(SUnit *SU) override;
void Reset() override;
};
Index: llvm/lib/Target/AMDGPU/GCNHazardRecognizer.cpp
===================================================================
--- llvm/lib/Target/AMDGPU/GCNHazardRecognizer.cpp
+++ llvm/lib/Target/AMDGPU/GCNHazardRecognizer.cpp
@@ -2136,28 +2136,4 @@
}
return WaitStatesNeeded;
-}
-
-bool GCNHazardRecognizer::ShouldPreferAnother(SUnit *SU) {
- if (!SU->isInstr())
- return false;
-
- const MachineInstr *MAI = nullptr;
- auto IsMFMAFn = [&MAI](const MachineInstr &MI) {
- MAI = nullptr;
- if (SIInstrInfo::isMAI(MI) &&
- MI.getOpcode() != AMDGPU::V_ACCVGPR_WRITE_B32_e64 &&
- MI.getOpcode() != AMDGPU::V_ACCVGPR_READ_B32_e64)
- MAI = &MI;
- return MAI != nullptr;
- };
-
- MachineInstr *MI = SU->getInstr();
- if (IsMFMAFn(*MI)) {
- int W = getWaitStatesSince(IsMFMAFn, 16);
- if (MAI)
- return W < (int)TSchedModel.computeInstrLatency(MAI);
- }
-
- return false;
-}
+}
\ No newline at end of file
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D127666.436433.patch
Type: text/x-patch
Size: 3275 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20220613/88497d0f/attachment.bin>
More information about the llvm-commits
mailing list