Skip to content

[Clang] Add memory attributeΒ #107029

@philnik777

Description

@philnik777

The LLVM IR has a memory attribute, which allows specifying memory access for different regions. Specifically, all memory, memory passed via arguments and inaccessible memory. All of these fields can be specified to have (1) no access, (2) read only access, (3) write only access or (4) read/write access. Combining these is also possible. That way it is possible to specify that a function can read/write global memory, but only read argument memory. That allows for really nice optimizations like removing dead calls to functions that only write to some memory (e.g. the frexp family of functions). It would be great if clang could expose this flexibility via an attribute. (Except maybe the inaccessible memory part, since that doesn't really seem like a useful concept outside of builtins)

Metadata

Metadata

Assignees

No one assigned

    Labels

    clang:frontendLanguage frontend issues, e.g. anything involving "Sema"enhancementImproving things as opposed to bug fixing, e.g. new or missing feature

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions