llvm-project icon indicating copy to clipboard operation
llvm-project copied to clipboard

[CIR][AMDGPU] Track: AMDGPU call-convention lowering in ClangIR via the LLVM ABI library

Open skc7 opened this issue 3 months ago • 2 comments

Summary:

  • Bring AMDGPU call-convention lowering to ClangIR by porting the classic CodeGen AMDGPU ABI classifier to the language-agnostic LLVM ABI library and wiring it into CIR's CallConvLoweringPass. This issue tracks the work.

PRs:

  • [x] #220579 - [CIR][ABI] Honor abi::ArgInfo::CanBeFlattened in the call-conv lowering
  • [x] #224994 - [ABI] Hoist isSingleElementStruct into TargetInfo and fix array reduction
  • [x] #225005 - [ABI] Add IndirectAliased kind to abi::ArgInfo
  • [x] #225301 - [ABI] Thread alloca address space through getNaturalAlignIndirect
  • [x] #225009 - [ABI] Add DefaultTargetInfo for default argument/return classification
  • [x] #220177 - [ABI] Add AMDGPU target ABI classifier to the LLVM ABI library
  • [x] #229792 - [CIR] Use alloca address space for CallConvLowering temporaries
  • [x] #230087 - [CIR] Lower non-power-of-two vectors in CallConvLowering
  • [x] #220197 - [CIR] Wire AMDGPU into the call-convention lowering pass
  • [x] #229991 - [mlir][ABI] Add indirect address space to ArgClassification
  • [x] #220207 - [CIR] Support array coercions and flattened direct structs in CallConvLowering
  • [x] #230415 - [CIR][mlir][ABI] Add IndirectAliased (byref) argument lowering
  • [x] #239151 - [CIR][AMDGPU] Look through address_space views of __retval in insertSRetStores
  • [x] #239158 - [CIR][AMDGPU] Look through address_space views when forwarding indirect args
  • [x] #239501 - [CIR][AMDGPU] Lower Indirect arguments and sret returns in addrspace(5)
  • [x] #241158 - [CIR] Track flexible array members in record layout and pass to ABI
  • [x] #241190 - [CIR] Flatten one-field structs in CallConvLowering
  • [x] #240808 - [CIR] Flatten wide _Complex arguments in CallConvLowering
  • [x] #241201 - [CIR] Flatten unions passed Direct in CallConvLowering
  • [x] #233822 - [CIR] Enable CallConvLowering for AMDGPU triples

This is still WIP and more PRs will be added as per requirement. I'll keep this issue updated as PRs land.

CC: @RiverDave @adams381 @steffenlarsen @ranapratap55

skc7 avatar Sep 02 '26 03:09 skc7

@andykaylor : FYI!

erichkeane avatar Sep 02 '26 14:09 erichkeane

cc: @koparasy -- It might also be worthwhile to start thinking about nvptx (for much later though).

RiverDave avatar Sep 02 '26 16:09 RiverDave