[llvm] [AMDGPU] Parse wwm filter flag for regalloc fast (PR #119347)

Akshat Oke via llvm-commits llvm-commits at lists.llvm.org
Tue Dec 10 01:22:47 PST 2024


https://github.com/optimisan created https://github.com/llvm/llvm-project/pull/119347

None

>From e9f2eae18d832e49b3c611301fb4e840a343fcb9 Mon Sep 17 00:00:00 2001
From: Akshat Oke <Akshat.Oke at amd.com>
Date: Tue, 10 Dec 2024 09:22:06 +0000
Subject: [PATCH] [AMDGPU] Parse wwm filter flag for regalloc fast

---
 llvm/lib/Target/AMDGPU/AMDGPUTargetMachine.cpp | 2 ++
 llvm/test/tools/llc/new-pm/regalloc-amdgpu.mir | 4 +++-
 2 files changed, 5 insertions(+), 1 deletion(-)

diff --git a/llvm/lib/Target/AMDGPU/AMDGPUTargetMachine.cpp b/llvm/lib/Target/AMDGPU/AMDGPUTargetMachine.cpp
index 34ad99dd980f27..06dc319963a342 100644
--- a/llvm/lib/Target/AMDGPU/AMDGPUTargetMachine.cpp
+++ b/llvm/lib/Target/AMDGPU/AMDGPUTargetMachine.cpp
@@ -870,6 +870,8 @@ void AMDGPUTargetMachine::registerPassBuilderCallbacks(PassBuilder &PB) {
           return onlyAllocateSGPRs;
         if (FilterName == "vgpr")
           return onlyAllocateVGPRs;
+        if (FilterName == "wwm")
+          return onlyAllocateWWMRegs;
         return nullptr;
       });
 }
diff --git a/llvm/test/tools/llc/new-pm/regalloc-amdgpu.mir b/llvm/test/tools/llc/new-pm/regalloc-amdgpu.mir
index f75db964e2d6e9..07f2d350ffd9c0 100644
--- a/llvm/test/tools/llc/new-pm/regalloc-amdgpu.mir
+++ b/llvm/test/tools/llc/new-pm/regalloc-amdgpu.mir
@@ -1,8 +1,10 @@
 # REQUIRES: amdgpu-registered-target
-# RUN: llc -mtriple=amdgcn --passes='regallocfast<filter=sgpr>' --print-pipeline-passes --filetype=null %s | FileCheck %s --check-prefix=PASS
+# 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
 # RUN: not llc -mtriple=amdgcn --passes='regallocfast<filter=bad-filter>' --print-pipeline-passes --filetype=null %s 2>&1 | FileCheck %s --check-prefix=BAD-FILTER
 
 # PASS: regallocfast<filter=sgpr>
+# PASS: regallocfast<filter=wwm>
+# PASS: regallocfast<filter=vgpr>
 # BAD-FILTER: invalid regallocfast register filter 'bad-filter'
 
 ---



More information about the llvm-commits mailing list