[PATCH] D158603: [AMDGPU][TargetMachine] Handle case when +extended-image-insts is set, and the user forces +wave64

Juan Manuel Martinez CaamaƱo via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Aug 23 05:35:52 PDT 2023


jmmartinez created this revision.
jmmartinez added a reviewer: arsenm.
Herald added subscribers: foad, kerbowa, hiraditya, tpr, dstuttard, yaxunl, jvesely, kzhuravl.
Herald added a project: All.
jmmartinez requested review of this revision.
Herald added subscribers: llvm-commits, wdng.
Herald added a project: LLVM.

Some functions from device_libs have the attribute
"target-features"="+extended-image-insts".

On targets that default to wave32, if wave64 is forced by the user,
the wave64 feature is dropped when initializing the subtarget because
the "target-features" attribute is already set.

This results in functions marked with "target-features"="+extended-image-insts"
being compiled as wave32, although wave64 was requested.

This patch is a workaround this issue.

If "target-features" is equal to "+extended-image-insts", the global and
function features are concatenated.

In the general case, we cannot just concatenate the global and function
features since they may be incompatible: The feature
"+wavefrontsize32,+wavefrontsize64" results in 64 as wavefrontsize.

Related to SWDEV-410182.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D158603

Files:
  llvm/lib/Target/AMDGPU/AMDGPUTargetMachine.cpp
  llvm/lib/Target/AMDGPU/AMDGPUTargetMachine.h
  llvm/lib/Target/AMDGPU/R600TargetMachine.cpp
  llvm/test/CodeGen/AMDGPU/extended-image-insts-wave32-wave64.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D158603.552677.patch
Type: text/x-patch
Size: 4173 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20230823/d24f5377/attachment.bin>


More information about the llvm-commits mailing list