[PATCH] D115888: [Attributor][Fix] Add default alignment to HeapToStack

Joseph Huber via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Dec 16 10:36:12 PST 2021


jhuber6 added a comment.

In D115888#3198157 <https://reviews.llvm.org/D115888#3198157>, @lebedev.ri wrote:

> In D115888#3198155 <https://reviews.llvm.org/D115888#3198155>, @jhuber6 wrote:
>
>> In D115888#3198139 <https://reviews.llvm.org/D115888#3198139>, @lebedev.ri wrote:
>>
>>> Shouldn't/can't you query the alignment for that pointer?
>>> Hardcoding anything like this is a sign of a problem.
>>
>> I haven't found an interface in LLVM to query default alignment information from malloc.
>
> I'm talking about attributor's `AAAlign` attribute here.

I'm not sure if deriving it is a solution here, considering that we are replacing a runtime call with defined default alignment with an alloca that should always at least match that. I can try using AAAlign to query it, my first thought was to use the element type of the bitcast that always follows the `__kmpc_alloc_shared` call, but @jdoerfert just told me to just pick whatever the default is when I asked. This issue comes from https://github.com/kokkos/kokkos/issues/4224.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D115888



More information about the llvm-commits mailing list