[llvm-dev] Opaque Pointers Help Wanted

Arthur Eubanks via llvm-dev llvm-dev at lists.llvm.org
Mon Jun 21 14:59:32 PDT 2021


Yes that's an issue, I commented on https://reviews.llvm.org/D61524.
One random hacky idea I had was to add an overloaded parameter that we
always pass undef/poison to but is of the type we care about. There's
probably a better way though.

On Mon, Jun 21, 2021 at 10:35 AM Craig Topper <craig.topper at gmail.com>
wrote:

> If I remember correctly, these 3 intrinsics need to be redesigned as they
> use a type overload on the pointer argument to recover a type. See code
> in BPFAbstractMemberAccess::IsPreserveDIAccessIndexCall.
>
> def int_preserve_array_access_index :
> DefaultAttrsIntrinsic<[llvm_anyptr_ty],
>                                                 [llvm_anyptr_ty,
> llvm_i32_ty,
>                                                  llvm_i32_ty],
>                                                 [IntrNoMem,
>                                                  ImmArg<ArgIndex<1>>,
>                                                  ImmArg<ArgIndex<2>>]>;
> def int_preserve_union_access_index :
> DefaultAttrsIntrinsic<[llvm_anyptr_ty],
>                                                 [llvm_anyptr_ty,
> llvm_i32_ty],
>                                                 [IntrNoMem,
>                                                  ImmArg<ArgIndex<1>>]>;
> def int_preserve_struct_access_index :
> DefaultAttrsIntrinsic<[llvm_anyptr_ty],
>                                                  [llvm_anyptr_ty,
> llvm_i32_ty,
>                                                   llvm_i32_ty],
>                                                  [IntrNoMem,
>                                                   ImmArg<ArgIndex<1>>,
>                                                   ImmArg<ArgIndex<2>>]>;
>
> ~Craig
>
>
> On Mon, Jun 21, 2021 at 9:03 AM Arthur Eubanks via llvm-dev <
> llvm-dev at lists.llvm.org> wrote:
>
>> For the opaque pointers project,
>> https://llvm.org/docs/OpaquePointers.html#transition-plan contains high
>> level steps for what to do before we can enable opaque pointers. (Looks
>> like the page hasn't been rebuilt in a while,
>> https://github.com/llvm/llvm-project/blob/main/llvm/docs/OpaquePointers.rst#transition-plan
>> contains some more concrete steps)
>>
>> Essentially almost all of the work boils down to figuring out how to
>> remove calls to `PointerType::getElementType()` and
>> `Type::getPointerElementType()`. Everything else derives from that.
>>
>> Any help with this is welcome and appreciated!
>> _______________________________________________
>> LLVM Developers mailing list
>> llvm-dev at lists.llvm.org
>> https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev
>>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20210621/e707b139/attachment.html>


More information about the llvm-dev mailing list