aboutsummaryrefslogtreecommitdiff
path: root/src/Sema.zig
diff options
context:
space:
mode:
authorJacob Young <jacobly0@users.noreply.github.com>2025-05-28 22:45:19 -0400
committerJacob Young <15544577+jacobly0@users.noreply.github.com>2025-05-29 03:57:48 -0400
commitc04be630d996a0e01fd3cf05e6cade006e4226ce (patch)
treeedd9d55ad05435b91bd3cb95208a76ead2001094 /src/Sema.zig
parentf25212a479c4f26566b6b851e245e49c6f508b96 (diff)
downloadzig-c04be630d996a0e01fd3cf05e6cade006e4226ce.tar.gz
zig-c04be630d996a0e01fd3cf05e6cade006e4226ce.zip
Legalize: introduce a new pass before liveness
Each target can opt into different sets of legalize features. By performing these transformations before liveness, instructions that become unreferenced will have up-to-date liveness information.
Diffstat (limited to 'src/Sema.zig')
-rw-r--r--src/Sema.zig10
1 files changed, 2 insertions, 8 deletions
diff --git a/src/Sema.zig b/src/Sema.zig
index 967fa3a23e..3fa264be48 100644
--- a/src/Sema.zig
+++ b/src/Sema.zig
@@ -756,13 +756,7 @@ pub const Block = struct {
fn addReduce(block: *Block, operand: Air.Inst.Ref, operation: std.builtin.ReduceOp) !Air.Inst.Ref {
const sema = block.sema;
const zcu = sema.pt.zcu;
- const vector_ty = sema.typeOf(operand);
- switch (vector_ty.vectorLen(zcu)) {
- 0 => unreachable,
- 1 => return block.addBinOp(.array_elem_val, operand, .zero_usize),
- else => {},
- }
- const allow_optimized = switch (vector_ty.childType(zcu).zigTypeTag(zcu)) {
+ const allow_optimized = switch (sema.typeOf(operand).childType(zcu).zigTypeTag(zcu)) {
.float => true,
.bool, .int => false,
else => unreachable,
@@ -36849,7 +36843,7 @@ fn typeOf(sema: *Sema, inst: Air.Inst.Ref) Type {
pub fn getTmpAir(sema: Sema) Air {
return .{
.instructions = sema.air_instructions.slice(),
- .extra = sema.air_extra.items,
+ .extra = sema.air_extra,
};
}