Skip to content

[OpaquePointers] ElementType only legal on intrinsics and inline asm #64459

Open
@wsmoses

Description

@wsmoses

@nikic

I'm trying to adapt some Julia + Enzyme (autodiff) code to opaque pointers and hitting an issue.

For a given differentiable argument, we'll duplicate that argument. If that argument is an sret that means there are now two "sret"-like arguments (sret have special semantics for julia's GC). Obviously two arguments marked sret is invalid. Therefore in a non-opaque pointer land I just added a special "enzyme_sret" string attribute, and all was well.

Unfortunately, this of course loses the inner sret type which presents issues when using Opaque pointers (Julia is only experimenting with that now). As string attributes (since Enzyme is presently out of tree) do not permit type arguments, I looked to preserve the type in a different way. To remedy this I tried using an elementtype attribute at that location. However, unfortunately I hit the issue that " Attribute 'elementtype' can only be applied to intrinsics and inline asm".

What would you recommend here to support opaque pointers in this context.

cc @vchuravy

Metadata

Metadata

Assignees

No one assigned

    Labels

    julialangopaque-pointersquestionA question, not bug report. Check out https://llvm.org/docs/GettingInvolved.html instead!

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions