Sema: remove all_vector_instructions logic

Backends can instead ask legalization on a per-instruction basis.
This commit is contained in:
Jacob Young
2025-05-30 12:13:18 -04:00
parent b4a0a082dc
commit 6198f7afb7
15 changed files with 222 additions and 195 deletions

View File

@@ -52,7 +52,7 @@ fn importBackend(comptime backend: std.builtin.CompilerBackend) type {
pub fn legalizeFeatures(pt: Zcu.PerThread, nav_index: InternPool.Nav.Index) *const Air.Legalize.Features {
const zcu = pt.zcu;
const target = &zcu.navFileScope(nav_index).mod.?.resolved_target.result;
switch (target_util.zigBackend(target.*, zcu.comp.config.use_llvm)) {
return switch (target_util.zigBackend(target.*, zcu.comp.config.use_llvm)) {
else => unreachable,
inline .stage2_llvm,
.stage2_c,
@@ -65,11 +65,8 @@ pub fn legalizeFeatures(pt: Zcu.PerThread, nav_index: InternPool.Nav.Index) *con
.stage2_sparc64,
.stage2_spirv64,
.stage2_powerpc,
=> |backend| {
const Backend = importBackend(backend);
return if (@hasDecl(Backend, "legalizeFeatures")) Backend.legalizeFeatures(target) else comptime &.initEmpty();
},
}
=> |backend| importBackend(backend).legalizeFeatures(target),
};
}
pub fn generateFunction(