Skip to content

Commit 0876c11

Browse files
authored
[AMDGPU] Parse wwm filter flag for regalloc fast (#119347)
1 parent 737d78a commit 0876c11

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

llvm/lib/Target/AMDGPU/AMDGPUTargetMachine.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -879,6 +879,8 @@ void AMDGPUTargetMachine::registerPassBuilderCallbacks(PassBuilder &PB) {
879879
return onlyAllocateSGPRs;
880880
if (FilterName == "vgpr")
881881
return onlyAllocateVGPRs;
882+
if (FilterName == "wwm")
883+
return onlyAllocateWWMRegs;
882884
return nullptr;
883885
});
884886
}

llvm/test/tools/llc/new-pm/regalloc-amdgpu.mir

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,10 @@
11
# REQUIRES: amdgpu-registered-target
2-
# RUN: llc -mtriple=amdgcn --passes='regallocfast<filter=sgpr>' --print-pipeline-passes --filetype=null %s | FileCheck %s --check-prefix=PASS
2+
# RUN: llc -mtriple=amdgcn --passes='regallocfast<filter=sgpr>,regallocfast<filter=wwm>,regallocfast<filter=vgpr>' --print-pipeline-passes --filetype=null %s | FileCheck %s --check-prefix=PASS
33
# RUN: not llc -mtriple=amdgcn --passes='regallocfast<filter=bad-filter>' --print-pipeline-passes --filetype=null %s 2>&1 | FileCheck %s --check-prefix=BAD-FILTER
44

55
# PASS: regallocfast<filter=sgpr>
6+
# PASS: regallocfast<filter=wwm>
7+
# PASS: regallocfast<filter=vgpr>
68
# BAD-FILTER: invalid regallocfast register filter 'bad-filter'
79

810
---

0 commit comments

Comments
 (0)