[PATCH] D103261: [AMDGPU] Increase alignment of LDS globals if necessary before LDS lowering.

Mahesha S via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Sun May 30 20:38:25 PDT 2021


hsmhsm added a comment.

In D103261#2787572 <https://reviews.llvm.org/D103261#2787572>, @JonChesterfield wrote:

> Not really the right place for this comment, but better odds of it being seen than in other bug trackers. Mahesha reports:
>
>   @lds = addrspace(3) global float undef, align 8
>   @gptr = addrspace(1) global i64* addrspacecast (float addrspace(3)* @lds to i64*), align 8
>   @llvm.used = appending global [2 x i8*] [i8* addrspacecast (i8 addrspace(3)* bitcast (float addrspace(3)* @lds to i8 addrspace(3)*) to i8*), i8* addrspacecast (i8 addrspace(1)* bitcast (i64* addrspace(1)* @gptr to i8 addrspace(1)*) to i8*)], section "llvm.metadata"
>   define void @f0() {
>     %ld = load i64*, i64* addrspace(1)* @gptr
>     ret void
>   }
>
> ^ that doesn't get transformed, suggesting a bug in shouldLowerLDSToStruct. The pattern of return !F for conservative should probably be repeated where it currently has return false. I thought we had a test case for storing address of LDS in a global, but presumably not.

In general, shouldLowerLDSToStruct() requires some clean-up and improvement in order to handle all scenarios including handling of constants for kernel LDS lowering, which we have not yet handled. Let me take all these missing things in a separate patch.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D103261



More information about the llvm-commits mailing list