[llvm] AMDGPU: Fix using IRAttribute with nounwind for AMDGPUNoAGPR (PR #161954)

Matt Arsenault via llvm-commits llvm-commits at lists.llvm.org
Sat Oct 4 04:09:51 PDT 2025


https://github.com/arsenm created https://github.com/llvm/llvm-project/pull/161954

Don't think this did anything harmful, but it doesn't make sense
to report this as implementing nounwind handling.

>From 55406f29fe15aa6b47da6571eb09a984d7555c35 Mon Sep 17 00:00:00 2001
From: Matt Arsenault <Matthew.Arsenault at amd.com>
Date: Sat, 4 Oct 2025 20:08:27 +0900
Subject: [PATCH] AMDGPU: Fix using IRAttribute with nounwind for AMDGPUNoAGPR

Don't think this did anything harmful, but it doesn't make sense
to report this as implementing nounwind handling.
---
 llvm/lib/Target/AMDGPU/AMDGPUAttributor.cpp | 8 +++-----
 1 file changed, 3 insertions(+), 5 deletions(-)

diff --git a/llvm/lib/Target/AMDGPU/AMDGPUAttributor.cpp b/llvm/lib/Target/AMDGPU/AMDGPUAttributor.cpp
index 9dd64e0f6b35b..8b72d356ebfeb 100644
--- a/llvm/lib/Target/AMDGPU/AMDGPUAttributor.cpp
+++ b/llvm/lib/Target/AMDGPU/AMDGPUAttributor.cpp
@@ -1225,11 +1225,9 @@ static bool inlineAsmUsesAGPRs(const InlineAsm *IA) {
 
 // TODO: Migrate to range merge of amdgpu-agpr-alloc.
 // FIXME: Why is this using Attribute::NoUnwind?
-struct AAAMDGPUNoAGPR
-    : public IRAttribute<Attribute::NoUnwind,
-                         StateWrapper<BooleanState, AbstractAttribute>,
-                         AAAMDGPUNoAGPR> {
-  AAAMDGPUNoAGPR(const IRPosition &IRP, Attributor &A) : IRAttribute(IRP) {}
+struct AAAMDGPUNoAGPR : public StateWrapper<BooleanState, AbstractAttribute> {
+  using Base = StateWrapper<BooleanState, AbstractAttribute>;
+  AAAMDGPUNoAGPR(const IRPosition &IRP, Attributor &A) : Base(IRP) {}
 
   static AAAMDGPUNoAGPR &createForPosition(const IRPosition &IRP,
                                            Attributor &A) {



More information about the llvm-commits mailing list