diff options
| author | Andrew Kelley <andrew@ziglang.org> | 2023-04-26 13:48:38 -0700 |
|---|---|---|
| committer | Andrew Kelley <andrew@ziglang.org> | 2023-04-28 13:24:43 -0700 |
| commit | 57ea6207d3cb2db706bdc06c14605e4b901736dd (patch) | |
| tree | e40302ce7199f5614d8b9c3cc9a3d70c782620ce /lib/std/Build.zig | |
| parent | 82fc360613e7070ffe7124fb070b151a382bd31b (diff) | |
| download | zig-57ea6207d3cb2db706bdc06c14605e4b901736dd.tar.gz zig-57ea6207d3cb2db706bdc06c14605e4b901736dd.zip | |
std.ArrayList: mark the appendNTimes methods inline
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.
Diffstat (limited to 'lib/std/Build.zig')
0 files changed, 0 insertions, 0 deletions
