Skip to content
This repository was archived by the owner on Feb 21, 2026. It is now read-only.

[CIR][AMDGPU] Add AMDGPU-specific function attributes for HIP/OpenCL kernels#2091

Merged
skc7 merged 3 commits intollvm:mainfrom
skc7:skc7/cir_attr_amdgpu
Jan 17, 2026
Merged

[CIR][AMDGPU] Add AMDGPU-specific function attributes for HIP/OpenCL kernels#2091
skc7 merged 3 commits intollvm:mainfrom
skc7:skc7/cir_attr_amdgpu

Conversation

@skc7
Copy link
Collaborator

@skc7 skc7 commented Dec 26, 2025

This patch adds support for AMDGPU-specific function attributes for HIP/OpenCL kernels

  • Added setTargetAttributes for AMDGPUTargetCIRGenInfo to set kernel attributes
  • Added generic string attribute handler in amendFunction to translate string-valued extra function attributes to LLVM function attributes

Follows OGCG AMDGPU implementation from "clang/lib/CodeGen/Targets/AMDGPU.cpp".

@skc7 skc7 force-pushed the skc7/cir_attr_amdgpu branch from 6f043a2 to b0994ce Compare December 26, 2025 09:07
@skc7 skc7 marked this pull request as ready for review December 26, 2025 10:44
@skc7
Copy link
Collaborator Author

skc7 commented Dec 27, 2025

All the attributes lowered in this PR are amdgpu llvm backend specific and I think CIR need not have a separate attribute for them at HIP level, (which prevents leakage of LLVM specific things into CIR).

@bcardosolopes
Copy link
Member

@koparasy any feedback on this one? You just touched ABI in f4fc087

@bcardosolopes
Copy link
Member

@skc7 seems like some conflict resolution is needed

@skc7 skc7 force-pushed the skc7/cir_attr_amdgpu branch from b0994ce to bf404ea Compare January 13, 2026 06:16
@skc7 skc7 requested a review from bcardosolopes January 14, 2026 04:51
Copy link
Member

@bcardosolopes bcardosolopes left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ready to land once conflict is fixed

@skc7 skc7 force-pushed the skc7/cir_attr_amdgpu branch from 32ef483 to 3660fd5 Compare January 17, 2026 05:32
@github-actions
Copy link

github-actions bot commented Jan 17, 2026

✅ With the latest revision this PR passed the C/C++ code formatter.

@skc7 skc7 merged commit f463d7d into llvm:main Jan 17, 2026
6 checks passed
@koparasy
Copy link
Contributor

Sorry I missed this.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants