mirror of
https://github.com/ziglang/zig.git
synced 2026-01-27 01:35:23 +00:00
The previous commit introduced an optimization to the LLVM backend that makes `@memset` lower more optimally when the element is comptime-known and has a repeating byte pattern. By making these functions inline, if the element parameter is comptime-known at the callsite, it will be comptime-known in the `@memset` call, causing more use of the LLVM `memset` intrinsic rather than an inline for loop when using the LLVM backend. This affects, for example, std.crypto.argon2, which calls appendNTimesAssumeCapacity with a `[128]u64` as the element. This is now lowered with a single `memset` call.