Skip to content

Commit 3dfa562

Browse files
committed
[AMDGPU] Add CL option for max-ilp scheduler.
When compiling for multiple targets the scheduler that is selected via the -misched option is applied globally. This patch adds a target CL option instead. Reviewed By: rampitec Differential Revision: https://reviews.llvm.org/D131022
1 parent 4bd9d98 commit 3dfa562

File tree

2 files changed

+10
-0
lines changed

2 files changed

+10
-0
lines changed

llvm/lib/Target/AMDGPU/AMDGPUTargetMachine.cpp

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -327,6 +327,11 @@ static cl::opt<bool> EnablePromoteKernelArguments(
327327
cl::desc("Enable promotion of flat kernel pointer arguments to global"),
328328
cl::Hidden, cl::init(true));
329329

330+
static cl::opt<bool> EnableMaxIlpSchedStrategy(
331+
"amdgpu-enable-max-ilp-scheduling-strategy",
332+
cl::desc("Enable scheduling strategy to maximize ILP for a single wave."),
333+
cl::Hidden, cl::init(false));
334+
330335
extern "C" LLVM_EXTERNAL_VISIBILITY void LLVMInitializeAMDGPUTarget() {
331336
// Register the target
332337
RegisterTargetMachine<R600TargetMachine> X(getTheAMDGPUTarget());
@@ -1161,6 +1166,10 @@ ScheduleDAGInstrs *GCNPassConfig::createMachineScheduler(
11611166
const GCNSubtarget &ST = C->MF->getSubtarget<GCNSubtarget>();
11621167
if (ST.enableSIScheduler())
11631168
return createSIMachineScheduler(C);
1169+
1170+
if (EnableMaxIlpSchedStrategy)
1171+
return createGCNMaxILPMachineScheduler(C);
1172+
11641173
return createGCNMaxOccupancyMachineScheduler(C);
11651174
}
11661175

llvm/test/CodeGen/AMDGPU/schedule-ilp.ll

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
; RUN: llc -march=amdgcn -mcpu=tonga -misched=gcn-iterative-ilp -verify-machineinstrs < %s | FileCheck %s
22
; RUN: llc -march=amdgcn -mcpu=tonga -misched=gcn-max-ilp -verify-machineinstrs < %s | FileCheck %s
3+
; RUN: llc -march=amdgcn -mcpu=tonga -amdgpu-enable-max-ilp-scheduling-strategy -verify-machineinstrs < %s | FileCheck %s
34

45
; CHECK: NumVgprs: {{[0-9][0-9][0-9]$}}
56

0 commit comments

Comments
 (0)