Skip to content

Commit 6817031

Browse files
committed
[AMDGPU] Disable FillMFMAShadowMutation by default
Disable amdgpu mfma power sched. Reviewed By: rampitec Differential Revision: https://reviews.llvm.org/D129172
1 parent bfa2c42 commit 6817031

File tree

2 files changed

+7
-6
lines changed

2 files changed

+7
-6
lines changed

llvm/lib/Target/AMDGPU/AMDGPUSubtarget.cpp

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -40,9 +40,9 @@ using namespace llvm;
4040
#include "AMDGPUGenSubtargetInfo.inc"
4141
#undef AMDGPUSubtarget
4242

43-
static cl::opt<bool> DisablePowerSched(
44-
"amdgpu-disable-power-sched",
45-
cl::desc("Disable scheduling to minimize mAI power bursts"),
43+
static cl::opt<bool> EnablePowerSched(
44+
"amdgpu-enable-power-sched",
45+
cl::desc("Enable scheduling to minimize mAI power bursts"),
4646
cl::init(false));
4747

4848
static cl::opt<bool> EnableVGPRIndexMode(
@@ -916,7 +916,7 @@ struct FillMFMAShadowMutation : ScheduleDAGMutation {
916916

917917
void apply(ScheduleDAGInstrs *DAGInstrs) override {
918918
const GCNSubtarget &ST = DAGInstrs->MF.getSubtarget<GCNSubtarget>();
919-
if (!ST.hasMAIInsts() || DisablePowerSched)
919+
if (!ST.hasMAIInsts())
920920
return;
921921
DAG = static_cast<ScheduleDAGMI*>(DAGInstrs);
922922
const TargetSchedModel *TSchedModel = DAGInstrs->getSchedModel();
@@ -966,7 +966,8 @@ void GCNSubtarget::getPostRAMutations(
966966

967967
std::unique_ptr<ScheduleDAGMutation>
968968
GCNSubtarget::createFillMFMAShadowMutation(const TargetInstrInfo *TII) const {
969-
return std::make_unique<FillMFMAShadowMutation>(&InstrInfo);
969+
return EnablePowerSched ? std::make_unique<FillMFMAShadowMutation>(&InstrInfo)
970+
: nullptr;
970971
}
971972

972973
const AMDGPUSubtarget &AMDGPUSubtarget::get(const MachineFunction &MF) {

llvm/test/CodeGen/AMDGPU/sched-prefer-non-mfma.mir

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# RUN: llc -march=amdgcn -mcpu=gfx908 -run-pass post-RA-sched -amdgpu-disable-power-sched -verify-machineinstrs -o - %s | FileCheck -check-prefix=GCN %s
1+
# RUN: llc -march=amdgcn -mcpu=gfx908 -run-pass post-RA-sched -verify-machineinstrs -o - %s | FileCheck -check-prefix=GCN %s
22

33
# GCN-LABEL: name: unrelated_mfma
44
# GCN: V_MFMA_F32_32X32X1F32

0 commit comments

Comments
 (0)