[llvm] [AMDGPU] Change isSingleLaneExecution to account for WWM enabling lanes even if there's only one workitem (PR #188316)
Matt Arsenault via llvm-commits
llvm-commits at lists.llvm.org
Mon Mar 30 12:52:01 PDT 2026
================
@@ -0,0 +1,108 @@
+; NOTE: Assertions have been autogenerated by utils/update_test_checks.py UTC_ARGS: --check-attributes --check-globals all --version 5
+; Test the generation of the attribute amdgpu-no-wwm
+; RUN: opt -S -mtriple=amdgcn-amd-amdhsa -mcpu=gfx900 -passes=amdgpu-attributor < %s | FileCheck -check-prefixes=GFX9 %s
+; RUN: opt -S -mtriple=amdgcn-amd-amdhsa -mcpu=gfx1010 -passes=amdgpu-attributor < %s | FileCheck -check-prefixes=GFX10 %s
+; RUN: opt -S -mtriple=amdgcn-amd-amdhsa -mcpu=gfx1100 -passes=amdgpu-attributor < %s | FileCheck -check-prefixes=GFX11 %s
+; RUN: opt -S -mtriple=amdgcn-amd-amdhsa -mcpu=gfx1200 -passes=amdgpu-attributor < %s | FileCheck -check-prefixes=GFX12 %s
+
+define amdgpu_kernel void @test_no_wwm(i32 %input, ptr addrspace(1) %out) {
+; GFX9-LABEL: define amdgpu_kernel void @test_no_wwm(
+; GFX9-SAME: i32 [[INPUT:%.*]], ptr addrspace(1) [[OUT:%.*]]) #[[ATTR0:[0-9]+]] {
+; GFX9-NEXT: store i32 [[INPUT]], ptr addrspace(1) [[OUT]], align 4
+; GFX9-NEXT: ret void
+;
+; GFX10-LABEL: define amdgpu_kernel void @test_no_wwm(
+; GFX10-SAME: i32 [[INPUT:%.*]], ptr addrspace(1) [[OUT:%.*]]) #[[ATTR0:[0-9]+]] {
+; GFX10-NEXT: store i32 [[INPUT]], ptr addrspace(1) [[OUT]], align 4
+; GFX10-NEXT: ret void
+;
+; GFX11-LABEL: define amdgpu_kernel void @test_no_wwm(
+; GFX11-SAME: i32 [[INPUT:%.*]], ptr addrspace(1) [[OUT:%.*]]) #[[ATTR0:[0-9]+]] {
+; GFX11-NEXT: store i32 [[INPUT]], ptr addrspace(1) [[OUT]], align 4
+; GFX11-NEXT: ret void
+;
+; GFX12-LABEL: define amdgpu_kernel void @test_no_wwm(
+; GFX12-SAME: i32 [[INPUT:%.*]], ptr addrspace(1) [[OUT:%.*]]) #[[ATTR0:[0-9]+]] {
+; GFX12-NEXT: store i32 [[INPUT]], ptr addrspace(1) [[OUT]], align 4
+; GFX12-NEXT: ret void
+;
+ store i32 %input, ptr addrspace(1) %out
+ ret void
+}
+
----------------
arsenm wrote:
Check a call works?
https://github.com/llvm/llvm-project/pull/188316
More information about the llvm-commits
mailing list