[PATCH] D80422: Enable `align <n>` to be used in intrinsic definitions.

Michael Liao via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri May 22 07:28:58 PDT 2020


hliao added a comment.

In D80422#2050863 <https://reviews.llvm.org/D80422#2050863>, @arsenm wrote:

> In D80422#2050474 <https://reviews.llvm.org/D80422#2050474>, @hliao wrote:
>
> > To prepare the refactoring on D80364 <https://reviews.llvm.org/D80364>, intrinsics interested should be specified with the alignment on the return pointer. With this patch, `amdgcn.dispatch.ptr` is defined as follows
> >
> >   def int_amdgcn_dispatch_ptr :
> >     Intrinsic<[LLVMQualPointerType<llvm_i8_ty, 4>], [],
> >     [Align<-1, 4>, IntrNoMem, IntrSpeculatable]>;
> >
>
>
> Referring to the return index by a negative parameter index is a bit weird. How does this work for multiple return values? Is it [-2, -1]? This needs documenting somewhere


There's no such thing. Multiple return values are always aggregated into a single struct and there's only one return value. Different from parameter indices, the return index for the attribute list is just 0 only.

  351 class AttributeList {                                                                                                                                                                                                                                     
  352 public:                                                                                                                                                                                                                                                   
  353   enum AttrIndex : unsigned {                                                                                                                                                                                                                             
  354     ReturnIndex = 0U,                                                                                                                                                                                                                                     
  355     FunctionIndex = ~0U,                                                                                                                                                                                                                                  
  356     FirstArgIndex = 1,                                                                                                                                                                                                                                    
  357   }; 


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D80422/new/

https://reviews.llvm.org/D80422





More information about the llvm-commits mailing list