aboutsummaryrefslogtreecommitdiff
path: root/src/Liveness.zig
diff options
context:
space:
mode:
authorAndrew Kelley <andrew@ziglang.org>2023-04-29 00:19:55 -0700
committerGitHub <noreply@github.com>2023-04-29 00:19:55 -0700
commitd65b42e07caa00dfe2f2fbf221c593ce57882784 (patch)
tree7926cbea1499e0affe930bf6d7455dc24adf014e /src/Liveness.zig
parentfd6200eda6d4fe19c34a59430a88a9ce38d6d7a4 (diff)
parentfa200ca0cad2705bad40eb723dedf4e3bf11f2ff (diff)
downloadzig-d65b42e07caa00dfe2f2fbf221c593ce57882784.tar.gz
zig-d65b42e07caa00dfe2f2fbf221c593ce57882784.zip
Merge pull request #15481 from ziglang/use-mem-intrinsics
actually use the new memory intrinsics
Diffstat (limited to 'src/Liveness.zig')
-rw-r--r--src/Liveness.zig14
1 files changed, 7 insertions, 7 deletions
diff --git a/src/Liveness.zig b/src/Liveness.zig
index 6990ade327..a1bfb73e2a 100644
--- a/src/Liveness.zig
+++ b/src/Liveness.zig
@@ -156,7 +156,7 @@ pub fn analyze(gpa: Allocator, air: Air) Allocator.Error!Liveness {
errdefer a.special.deinit(gpa);
defer a.extra.deinit(gpa);
- std.mem.set(usize, a.tomb_bits, 0);
+ @memset(a.tomb_bits, 0);
const main_body = air.getMainBody();
@@ -1150,7 +1150,7 @@ fn analyzeInst(
if (args.len + 1 <= bpi - 1) {
var buf = [1]Air.Inst.Ref{.none} ** (bpi - 1);
buf[0] = callee;
- std.mem.copy(Air.Inst.Ref, buf[1..], args);
+ @memcpy(buf[1..][0..args.len], args);
return analyzeOperands(a, pass, data, inst, buf);
}
@@ -1189,7 +1189,7 @@ fn analyzeInst(
if (elements.len <= bpi - 1) {
var buf = [1]Air.Inst.Ref{.none} ** (bpi - 1);
- std.mem.copy(Air.Inst.Ref, &buf, elements);
+ @memcpy(buf[0..elements.len], elements);
return analyzeOperands(a, pass, data, inst, buf);
}
@@ -1255,7 +1255,7 @@ fn analyzeInst(
if (buf_index + inputs.len > buf.len) {
break :simple buf_index + inputs.len;
}
- std.mem.copy(Air.Inst.Ref, buf[buf_index..], inputs);
+ @memcpy(buf[buf_index..][0..inputs.len], inputs);
return analyzeOperands(a, pass, data, inst, buf);
};
@@ -1841,7 +1841,7 @@ fn analyzeInstSwitchBr(
var case_infos = try gpa.alloc(ControlBranchInfo, ncases + 1); // +1 for else
defer gpa.free(case_infos);
- std.mem.set(ControlBranchInfo, case_infos, .{});
+ @memset(case_infos, .{});
defer for (case_infos) |*info| {
info.branch_deaths.deinit(gpa);
info.live_set.deinit(gpa);
@@ -1898,7 +1898,7 @@ fn analyzeInstSwitchBr(
const mirrored_deaths = try gpa.alloc(DeathList, ncases + 1);
defer gpa.free(mirrored_deaths);
- std.mem.set(DeathList, mirrored_deaths, .{});
+ @memset(mirrored_deaths, .{});
defer for (mirrored_deaths) |*md| md.deinit(gpa);
{
@@ -1993,7 +1993,7 @@ fn AnalyzeBigOperands(comptime pass: LivenessPass) type {
};
errdefer a.gpa.free(extra_tombs);
- std.mem.set(u32, extra_tombs, 0);
+ @memset(extra_tombs, 0);
const will_die_immediately: bool = switch (pass) {
.loop_analysis => false, // track everything, since we don't have full liveness information yet