Skip to content

memset and memcpy builtins should have alignment parameter #247

@andrewrk

Description

@andrewrk

Alignment must be known at compile time. If the source and destination pointers are known to be aligned to a value that is greater than 1, this can allow more optimal code generation. Otherwise, an alignment of 1 will still work fine. Alignment must be a power of 2.

Additionally, the existence of this parameter will encourage users to use @import("std").mem.copy and @import("std").mem.set rather than unsafe low level intrinsics, and those who use these builtins will think more carefully when they decide to use it.

http://llvm.org/docs/LangRef.html#llvm-memcpy-intrinsic

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementSolving this issue will likely involve adding new logic or components to the codebase.

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions