[clang] [llvm] [AMDGPU][Clang] Allow amdgpu-waves-per-eu attribute to lower target occupancy range (PR #138284)

2025-05-08 Thread Lucas Ramirez via cfe-commits
https://github.com/lucas-rami updated https://github.com/llvm/llvm-project/pull/138284 Rate limit · GitHub body { background-color: #f6f8fa; color: #24292e; font-family: -apple-system,BlinkMacSystemFont,Segoe UI,Helvetica,Arial,san

[clang] [llvm] [AMDGPU] Allow 0 as min./max. of amdgpu-waves-per-eu (PR #138284)

2025-05-07 Thread Lucas Ramirez via cfe-commits
https://github.com/lucas-rami updated https://github.com/llvm/llvm-project/pull/138284 Rate limit · GitHub body { background-color: #f6f8fa; color: #24292e; font-family: -apple-system,BlinkMacSystemFont,Segoe UI,Helvetica,Arial,san

[clang] [llvm] [AMDGPU] Allow 0 as min./max. of amdgpu-waves-per-eu (PR #138284)

2025-05-07 Thread Lucas Ramirez via cfe-commits
lucas-rami wrote: > It doesn't add the attribute if it's 0? Indeed I missed this, sorry. > I don't see a reason to support this on the IR level. We should just make it > a verifier error to use 0. After further investigation and from what I can understand sema already rejects a minimum of 0

[clang] [llvm] [AMDGPU] Allow 0 as min./max. of amdgpu-waves-per-eu (PR #138284)

2025-05-07 Thread Lucas Ramirez via cfe-commits
https://github.com/lucas-rami edited https://github.com/llvm/llvm-project/pull/138284 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] [AMDGPU][Clang] Allow amdgpu-waves-per-eu attribute to lower target occupancy range (PR #138284)

2025-05-07 Thread Lucas Ramirez via cfe-commits
https://github.com/lucas-rami edited https://github.com/llvm/llvm-project/pull/138284 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] [AMDGPU][Clang] Allow amdgpu-waves-per-eu attribute to lower target occupancy range (PR #138284)

2025-05-07 Thread Lucas Ramirez via cfe-commits
https://github.com/lucas-rami edited https://github.com/llvm/llvm-project/pull/138284 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] [AMDGPU][Clang] Allow amdgpu-waves-per-eu attribute to lower target occupancy range (PR #138284)

2025-05-22 Thread Lucas Ramirez via cfe-commits
@@ -279,7 +268,7 @@ define amdgpu_kernel void @kernel_3_6() #12 { ; 3,6 -> 6,9 define internal void @refine_upper_func_3_6() #13 { ; CHECK-LABEL: define internal void @refine_upper_func_3_6 -; CHECK-SAME: () #[[ATTR9]] { +; CHECK-SAME: () #[[ATTR14:[0-9]+]] { l

[clang] [llvm] [AMDGPU][Clang] Allow amdgpu-waves-per-eu attribute to lower target occupancy range (PR #138284)

2025-05-22 Thread Lucas Ramirez via cfe-commits
https://github.com/lucas-rami updated https://github.com/llvm/llvm-project/pull/138284 >From 9906334cbabf160221dea11aa93e2cf7a154e6da Mon Sep 17 00:00:00 2001 From: Lucas Ramirez Date: Thu, 22 May 2025 13:26:57 + Subject: [PATCH] Rebase on main (integrate changes from 1b34722) --- clang/l

[clang] [llvm] [AMDGPU][Clang] Allow amdgpu-waves-per-eu attribute to lower target occupancy range (PR #138284)

2025-05-22 Thread Lucas Ramirez via cfe-commits
https://github.com/lucas-rami updated https://github.com/llvm/llvm-project/pull/138284 >From 9906334cbabf160221dea11aa93e2cf7a154e6da Mon Sep 17 00:00:00 2001 From: Lucas Ramirez Date: Thu, 22 May 2025 13:26:57 + Subject: [PATCH 1/2] Rebase on main (integrate changes from 1b34722) --- cla

[clang] [llvm] [AMDGPU][Clang] Allow amdgpu-waves-per-eu attribute to lower target occupancy range (PR #138284)

2025-06-26 Thread Lucas Ramirez via cfe-commits
https://github.com/lucas-rami updated https://github.com/llvm/llvm-project/pull/138284 >From b277b2e90a3665c5e945ddff47c6c55a7fdb8d33 Mon Sep 17 00:00:00 2001 From: Lucas Ramirez Date: Thu, 22 May 2025 13:26:57 + Subject: [PATCH 1/2] Rebase on main (integrate changes from 1b34722) --- cla

[clang] [llvm] [AMDGPU][Clang] Allow amdgpu-waves-per-eu attribute to lower target occupancy range (PR #138284)

2025-06-26 Thread Lucas Ramirez via cfe-commits
lucas-rami wrote: ping https://github.com/llvm/llvm-project/pull/138284 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] [AMDGPU][Clang] Allow amdgpu-waves-per-eu attribute to lower target occupancy range (PR #138284)

2025-06-26 Thread Lucas Ramirez via cfe-commits
lucas-rami wrote: > IIUC that is because the flat workgroup size. Waves per EU must yield to the > value computed from flat workgroup size, and if it is absent, we must assume > it can be 1024. AFAIU the intent of the existing implementation is that the default minimum waves/EU is set so that

[clang] [llvm] [AMDGPU][Clang] Allow amdgpu-waves-per-eu attribute to lower target occupancy range (PR #138284)

2025-06-27 Thread Lucas Ramirez via cfe-commits
https://github.com/lucas-rami updated https://github.com/llvm/llvm-project/pull/138284 >From b277b2e90a3665c5e945ddff47c6c55a7fdb8d33 Mon Sep 17 00:00:00 2001 From: Lucas Ramirez Date: Thu, 22 May 2025 13:26:57 + Subject: [PATCH 1/3] Rebase on main (integrate changes from 1b34722) --- cla

[clang] [llvm] [AMDGPU][Clang] Allow amdgpu-waves-per-eu attribute to lower target occupancy range (PR #138284)

2025-06-27 Thread Lucas Ramirez via cfe-commits
@@ -0,0 +1,40 @@ +; RUN: not llvm-as -disable-output %s 2>&1 | FileCheck %s + +target triple = "amdgcn-amd-amdhsa" + +define void @valid_amdgpu_waves_per_eu_range() "amdgpu-waves-per-eu"="2,4" { + ret void +} lucas-rami wrote: Will keep that in mind, thanks. ht

[clang] [llvm] [AMDGPU][Clang] Allow amdgpu-waves-per-eu attribute to lower target occupancy range (PR #138284)

2025-06-27 Thread Lucas Ramirez via cfe-commits
@@ -46,7 +46,6 @@ __attribute__((amdgpu_num_sgpr(4294967296))) kernel void kernel_num_sgpr_L() {} __attribute__((amdgpu_num_vgpr(4294967296))) kernel void kernel_num_vgpr_L() {} // expected-error {{integer constant expression evaluates to value 4294967296 that cannot be repres

[clang] [llvm] [AMDGPU][Clang] Allow amdgpu-waves-per-eu attribute to lower target occupancy range (PR #138284)

2025-06-27 Thread Lucas Ramirez via cfe-commits
@@ -2519,6 +2519,29 @@ void Verifier::verifyFunctionAttrs(FunctionType *FT, AttributeList Attrs, CheckFailed("invalid value for 'denormal-fp-math-f32' attribute: " + S, V); } + + if (TT.isAMDGPU()) { +if (auto A = Attrs.getFnAttr("amdgpu-waves-pe

[clang] [llvm] [AMDGPU][Clang] Allow amdgpu-waves-per-eu attribute to lower target occupancy range (PR #138284)

2025-06-27 Thread Lucas Ramirez via cfe-commits
https://github.com/lucas-rami edited https://github.com/llvm/llvm-project/pull/138284 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits