authorgravatar for jacobly@ziglang.orgJacob Young <jacobly@ziglang.org> 2026-06-24 00:39:25-04:00
committergravatar for jacobly@ziglang.orgJacob Young <jacobly@ziglang.org> 2026-07-27 14:35:12-04:00
log1e4b0e0022fcbda51032fe555d948ae59db3f640
tree3e0e5c6265b62289ca13c163c7a8f082b9a63c3d
parentc6ab46cc3effecd18db8b8469de965eafd02e1fd

llvm: update attributes and intrinsics


1 files changed, 758 insertions(+), 453 deletions(-)

lib/std/zig/llvm/Builder.zig+758-453
...@@ -142,8 +142,8 @@ pub const String = enum(u32) {...@@ -142,8 +142,8 @@ pub const String = enum(u32) {
142 }142 }
143143
144 fn fromIndex(index: ?usize) String {144 fn fromIndex(index: ?usize) String {
145 return @fromBackingInt(@intCast(@as(u32, @intCast((index orelse return .none) +145 return @fromBackingInt(@as(u32, @intCast((index orelse return .none) +
146 @backingInt(String.empty)))));146 @backingInt(String.empty))));
147 }147 }
148148
149 fn toIndex(self: String) ?usize {149 fn toIndex(self: String) ?usize {
...@@ -937,6 +937,7 @@ pub const Attribute = union(Kind) {...@@ -937,6 +937,7 @@ pub const Attribute = union(Kind) {
937 // Parameter Attributes937 // Parameter Attributes
938 zeroext,938 zeroext,
939 signext,939 signext,
940 noext,
940 inreg,941 inreg,
941 byval: Type,942 byval: Type,
942 byref: Type,943 byref: Type,
...@@ -947,6 +948,7 @@ pub const Attribute = union(Kind) {...@@ -947,6 +948,7 @@ pub const Attribute = union(Kind) {
947 @"align": Alignment.Lazy,948 @"align": Alignment.Lazy,
948 @"noalias",949 @"noalias",
949 nocapture,950 nocapture,
951 captures: Captures,
950 nofree,952 nofree,
951 nest,953 nest,
952 returned,954 returned,
...@@ -965,6 +967,11 @@ pub const Attribute = union(Kind) {...@@ -965,6 +967,11 @@ pub const Attribute = union(Kind) {
965 readnone,967 readnone,
966 readonly,968 readonly,
967 writeonly,969 writeonly,
970 writable,
971 initializes: []const [2]u64,
972 dead_on_unwind,
973 dead_on_return: ?u32,
974 range: [2]Constant,
968975
969 // Function Attributes976 // Function Attributes
970 //alignstack: Alignment.Lazy,977 //alignstack: Alignment.Lazy,
...@@ -974,7 +981,7 @@ pub const Attribute = union(Kind) {...@@ -974,7 +981,7 @@ pub const Attribute = union(Kind) {
974 builtin,981 builtin,
975 cold,982 cold,
976 convergent,983 convergent,
977 disable_sanitizer_information,984 disable_sanitizer_instrumentation,
978 fn_ret_thunk_extern,985 fn_ret_thunk_extern,
979 hot,986 hot,
980 inlinehint,987 inlinehint,
...@@ -984,6 +991,7 @@ pub const Attribute = union(Kind) {...@@ -984,6 +991,7 @@ pub const Attribute = union(Kind) {
984 naked,991 naked,
985 nobuiltin,992 nobuiltin,
986 nocallback,993 nocallback,
994 nodivergencesource,
987 noduplicate,995 noduplicate,
988 //nofree,996 //nofree,
989 noimplicitfloat,997 noimplicitfloat,
...@@ -1001,6 +1009,7 @@ pub const Attribute = union(Kind) {...@@ -1001,6 +1009,7 @@ pub const Attribute = union(Kind) {
1001 nosanitize_bounds,1009 nosanitize_bounds,
1002 nosanitize_coverage,1010 nosanitize_coverage,
1003 null_pointer_is_valid,1011 null_pointer_is_valid,
1012 optdebug,
1004 optforfuzzing,1013 optforfuzzing,
1005 optnone,1014 optnone,
1006 optsize,1015 optsize,
...@@ -1012,23 +1021,23 @@ pub const Attribute = union(Kind) {...@@ -1012,23 +1021,23 @@ pub const Attribute = union(Kind) {
1012 sanitize_thread,1021 sanitize_thread,
1013 sanitize_hwaddress,1022 sanitize_hwaddress,
1014 sanitize_memtag,1023 sanitize_memtag,
1024 sanitize_realtime,
1025 sanitize_realtime_blocking,
1026 sanitize_alloc_token,
1015 speculative_load_hardening,1027 speculative_load_hardening,
1016 speculatable,1028 speculatable,
1017 ssp,1029 ssp,
1018 sspstrong,1030 sspstrong,
1019 sspreq,1031 sspreq,
1020 strictfp,1032 strictfp,
1033 denormal_fpenv,
1021 uwtable: UwTable,1034 uwtable: UwTable,
1022 nocf_check,1035 nocf_check,
1023 shadowcallstack,1036 shadowcallstack,
1024 mustprogress,1037 mustprogress,
1025 vscale_range: VScaleRange,1038 vscale_range: VScaleRange,
10261039 nooutline,
1027 // Global Attributes1040 nocreateundeforpoison,
1028 no_sanitize_address,
1029 no_sanitize_hwaddress,
1030 //sanitize_memtag,
1031 sanitize_address_dyninit,
10321041
1033 string: struct { kind: String, value: String },1042 string: struct { kind: String, value: String },
1034 none: noreturn,1043 none: noreturn,
...@@ -1045,100 +1054,11 @@ pub const Attribute = union(Kind) {...@@ -1045,100 +1054,11 @@ pub const Attribute = union(Kind) {
1045 const storage = self.toStorage(builder);1054 const storage = self.toStorage(builder);
1046 if (storage.kind.toString()) |kind| return .{ .string = .{1055 if (storage.kind.toString()) |kind| return .{ .string = .{
1047 .kind = kind,1056 .kind = kind,
1048 .value = @fromBackingInt(@intCast(storage.value)),1057 .value = @fromBackingInt(storage.value),
1049 } } else return switch (storage.kind) {1058 } } else return switch (storage.kind) {
1050 inline .zeroext,1059 inline else => |kind| {
1051 .signext,
1052 .inreg,
1053 .byval,
1054 .byref,
1055 .preallocated,
1056 .inalloca,
1057 .sret,
1058 .elementtype,
1059 .@"align",
1060 .@"noalias",
1061 .nocapture,
1062 .nofree,
1063 .nest,
1064 .returned,
1065 .nonnull,
1066 .dereferenceable,
1067 .dereferenceable_or_null,
1068 .swiftself,
1069 .swiftasync,
1070 .swifterror,
1071 .immarg,
1072 .noundef,
1073 .nofpclass,
1074 .alignstack,
1075 .allocalign,
1076 .allocptr,
1077 .readnone,
1078 .readonly,
1079 .writeonly,
1080 //.alignstack,
1081 .allockind,
1082 .allocsize,
1083 .alwaysinline,
1084 .builtin,
1085 .cold,
1086 .convergent,
1087 .disable_sanitizer_information,
1088 .fn_ret_thunk_extern,
1089 .hot,
1090 .inlinehint,
1091 .jumptable,
1092 .memory,
1093 .minsize,
1094 .naked,
1095 .nobuiltin,
1096 .nocallback,
1097 .noduplicate,
1098 //.nofree,
1099 .noimplicitfloat,
1100 .@"noinline",
1101 .nomerge,
1102 .nonlazybind,
1103 .noprofile,
1104 .skipprofile,
1105 .noredzone,
1106 .noreturn,
1107 .norecurse,
1108 .willreturn,
1109 .nosync,
1110 .nounwind,
1111 .nosanitize_bounds,
1112 .nosanitize_coverage,
1113 .null_pointer_is_valid,
1114 .optforfuzzing,
1115 .optnone,
1116 .optsize,
1117 //.preallocated,
1118 .returns_twice,
1119 .safestack,
1120 .sanitize_address,
1121 .sanitize_memory,
1122 .sanitize_thread,
1123 .sanitize_hwaddress,
1124 .sanitize_memtag,
1125 .speculative_load_hardening,
1126 .speculatable,
1127 .ssp,
1128 .sspstrong,
1129 .sspreq,
1130 .strictfp,
1131 .uwtable,
1132 .nocf_check,
1133 .shadowcallstack,
1134 .mustprogress,
1135 .vscale_range,
1136 .no_sanitize_address,
1137 .no_sanitize_hwaddress,
1138 .sanitize_address_dyninit,
1139 => |kind| {
1140 const field_name, const field_type = comptime blk: {1060 const field_name, const field_type = comptime blk: {
1141 @setEvalBranchQuota(10_000);1061 @setEvalBranchQuota(12_000);
1142 const info = @typeInfo(Attribute).@"union";1062 const info = @typeInfo(Attribute).@"union";
1143 for (info.field_names, info.field_types) |field_name, field_type| {1063 for (info.field_names, info.field_types) |field_name, field_type| {
1144 if (std.mem.eql(u8, field_name, @tagName(kind))) break :blk .{ field_name, field_type };1064 if (std.mem.eql(u8, field_name, @tagName(kind))) break :blk .{ field_name, field_type };
...@@ -1149,14 +1069,17 @@ pub const Attribute = union(Kind) {...@@ -1149,14 +1069,17 @@ pub const Attribute = union(Kind) {
1149 return @unionInit(Attribute, field_name, switch (field_type) {1069 return @unionInit(Attribute, field_name, switch (field_type) {
1150 void => {},1070 void => {},
1151 u32 => storage.value,1071 u32 => storage.value,
1152 Alignment.Lazy, String, Type, UwTable => @fromBackingInt(@intCast(storage.value)),1072 Alignment.Lazy, String, Type, UwTable => @fromBackingInt(storage.value),
1153 AllocKind, AllocSize, FpClass, Memory, VScaleRange => @bitCast(storage.value),1073 AllocKind, AllocSize, Captures, FpClass, Memory, VScaleRange => @bitCast(storage.value),
1154 else => @compileError("bad payload type: " ++ field_name ++ ": " ++1074 else => @compileError("bad payload type: " ++ field_name ++ ": " ++
1155 @typeName(field_type)),1075 @typeName(field_type)),
1156 });1076 });
1157 },1077 },
1158 .string, .none => unreachable,1078 .initializes,
1159 _ => unreachable,1079 .dead_on_return,
1080 .range,
1081 => @panic("TODO"),
1082 .string, .none, _ => unreachable,
1160 };1083 };
1161 }1084 }
11621085
...@@ -1174,6 +1097,7 @@ pub const Attribute = union(Kind) {...@@ -1174,6 +1097,7 @@ pub const Attribute = union(Kind) {
1174 switch (attribute) {1097 switch (attribute) {
1175 .zeroext,1098 .zeroext,
1176 .signext,1099 .signext,
1100 .noext,
1177 .inreg,1101 .inreg,
1178 .@"noalias",1102 .@"noalias",
1179 .nocapture,1103 .nocapture,
...@@ -1191,11 +1115,13 @@ pub const Attribute = union(Kind) {...@@ -1191,11 +1115,13 @@ pub const Attribute = union(Kind) {
1191 .readnone,1115 .readnone,
1192 .readonly,1116 .readonly,
1193 .writeonly,1117 .writeonly,
1118 .writable,
1119 .dead_on_unwind,
1194 .alwaysinline,1120 .alwaysinline,
1195 .builtin,1121 .builtin,
1196 .cold,1122 .cold,
1197 .convergent,1123 .convergent,
1198 .disable_sanitizer_information,1124 .disable_sanitizer_instrumentation,
1199 .fn_ret_thunk_extern,1125 .fn_ret_thunk_extern,
1200 .hot,1126 .hot,
1201 .inlinehint,1127 .inlinehint,
...@@ -1204,6 +1130,7 @@ pub const Attribute = union(Kind) {...@@ -1204,6 +1130,7 @@ pub const Attribute = union(Kind) {
1204 .naked,1130 .naked,
1205 .nobuiltin,1131 .nobuiltin,
1206 .nocallback,1132 .nocallback,
1133 .nodivergencesource,
1207 .noduplicate,1134 .noduplicate,
1208 .noimplicitfloat,1135 .noimplicitfloat,
1209 .@"noinline",1136 .@"noinline",
...@@ -1220,6 +1147,7 @@ pub const Attribute = union(Kind) {...@@ -1220,6 +1147,7 @@ pub const Attribute = union(Kind) {
1220 .nosanitize_bounds,1147 .nosanitize_bounds,
1221 .nosanitize_coverage,1148 .nosanitize_coverage,
1222 .null_pointer_is_valid,1149 .null_pointer_is_valid,
1150 .optdebug,
1223 .optforfuzzing,1151 .optforfuzzing,
1224 .optnone,1152 .optnone,
1225 .optsize,1153 .optsize,
...@@ -1230,18 +1158,21 @@ pub const Attribute = union(Kind) {...@@ -1230,18 +1158,21 @@ pub const Attribute = union(Kind) {
1230 .sanitize_thread,1158 .sanitize_thread,
1231 .sanitize_hwaddress,1159 .sanitize_hwaddress,
1232 .sanitize_memtag,1160 .sanitize_memtag,
1161 .sanitize_realtime,
1162 .sanitize_realtime_blocking,
1163 .sanitize_alloc_token,
1233 .speculative_load_hardening,1164 .speculative_load_hardening,
1234 .speculatable,1165 .speculatable,
1235 .ssp,1166 .ssp,
1236 .sspstrong,1167 .sspstrong,
1237 .sspreq,1168 .sspreq,
1238 .strictfp,1169 .strictfp,
1170 .denormal_fpenv,
1239 .nocf_check,1171 .nocf_check,
1240 .shadowcallstack,1172 .shadowcallstack,
1241 .mustprogress,1173 .mustprogress,
1242 .no_sanitize_address,1174 .nooutline,
1243 .no_sanitize_hwaddress,1175 .nocreateundeforpoison,
1244 .sanitize_address_dyninit,
1245 => try w.print(" {s}", .{@tagName(attribute)}),1176 => try w.print(" {s}", .{@tagName(attribute)}),
1246 .byval,1177 .byval,
1247 .byref,1178 .byref,
...@@ -1254,6 +1185,45 @@ pub const Attribute = union(Kind) {...@@ -1254,6 +1185,45 @@ pub const Attribute = union(Kind) {
1254 .dereferenceable,1185 .dereferenceable,
1255 .dereferenceable_or_null,1186 .dereferenceable_or_null,
1256 => |size| try w.print(" {s}({d})", .{ @tagName(attribute), size }),1187 => |size| try w.print(" {s}({d})", .{ @tagName(attribute), size }),
1188 .captures => |captures| {
1189 try w.print(" {s}(", .{@tagName(attribute)});
1190 var need_comma = false;
1191 if (captures == Captures.none) {
1192 if (need_comma) try w.writeAll(", ");
1193 try w.writeAll("none");
1194 need_comma = true;
1195 }
1196 inline for (@typeInfo(Captures).@"struct".field_names) |field_name| {
1197 if (comptime std.mem.eql(u8, field_name, "_")) continue;
1198 const components = @field(captures, field_name);
1199 if (components != Captures.Components.none) {
1200 if (!comptime std.mem.eql(u8, field_name, "other")) {
1201 if (need_comma) try w.writeAll(", ");
1202 try w.writeAll(field_name ++ ": ");
1203 need_comma = false;
1204 }
1205 if (components.address) {
1206 if (need_comma) try w.writeAll(", ");
1207 try w.writeAll("address");
1208 need_comma = true;
1209 } else if (components.address_is_null) {
1210 if (need_comma) try w.writeAll(", ");
1211 try w.writeAll("address_is_null");
1212 need_comma = true;
1213 }
1214 if (components.provenance) {
1215 if (need_comma) try w.writeAll(", ");
1216 try w.writeAll("provenance");
1217 need_comma = true;
1218 } else if (components.read_provenance) {
1219 if (need_comma) try w.writeAll(", ");
1220 try w.writeAll("read_provenance");
1221 need_comma = true;
1222 }
1223 }
1224 }
1225 try w.writeByte(')');
1226 },
1257 .nofpclass => |fpclass| {1227 .nofpclass => |fpclass| {
1258 const Int = @typeInfo(FpClass).@"struct".backing_integer.?;1228 const Int = @typeInfo(FpClass).@"struct".backing_integer.?;
1259 try w.print(" {s}(", .{@tagName(attribute)});1229 try w.print(" {s}(", .{@tagName(attribute)});
...@@ -1281,6 +1251,9 @@ pub const Attribute = union(Kind) {...@@ -1281,6 +1251,9 @@ pub const Attribute = union(Kind) {
1281 try w.print("({d})", .{alignment_bytes});1251 try w.print("({d})", .{alignment_bytes});
1282 }1252 }
1283 },1253 },
1254 .initializes => @panic("TODO"),
1255 .dead_on_return => @panic("TODO"),
1256 .range => @panic("TODO"),
1284 .allockind => |allockind| {1257 .allockind => |allockind| {
1285 try w.print(" {t}(\"", .{attribute});1258 try w.print(" {t}(\"", .{attribute});
1286 var any = false;1259 var any = false;
...@@ -1344,100 +1317,109 @@ pub const Attribute = union(Kind) {...@@ -1344,100 +1317,109 @@ pub const Attribute = union(Kind) {
13441317
1345 pub const Kind = enum(u32) {1318 pub const Kind = enum(u32) {
1346 // Parameter Attributes1319 // Parameter Attributes
1347 zeroext = 34,1320 zeroext = @backingInt(ATTR_KIND.Z_EXT),
1348 signext = 24,1321 signext = @backingInt(ATTR_KIND.S_EXT),
1349 inreg = 5,1322 noext = @backingInt(ATTR_KIND.NO_EXT),
1350 byval = 3,1323 inreg = @backingInt(ATTR_KIND.IN_REG),
1351 byref = 69,1324 byval = @backingInt(ATTR_KIND.BY_VAL),
1352 preallocated = 65,1325 byref = @backingInt(ATTR_KIND.BYREF),
1353 inalloca = 38,1326 preallocated = @backingInt(ATTR_KIND.PREALLOCATED),
1354 sret = 29, // TODO: ?1327 inalloca = @backingInt(ATTR_KIND.IN_ALLOCA),
1355 elementtype = 77,1328 sret = @backingInt(ATTR_KIND.STRUCT_RET),
1356 @"align" = 1,1329 elementtype = @backingInt(ATTR_KIND.ELEMENTTYPE),
1357 @"noalias" = 9,1330 @"align" = @backingInt(ATTR_KIND.ALIGNMENT),
1358 nocapture = 11,1331 @"noalias" = @backingInt(ATTR_KIND.NO_ALIAS),
1359 nofree = 62,1332 nocapture = @backingInt(ATTR_KIND.NO_CAPTURE),
1360 nest = 8,1333 captures = @backingInt(ATTR_KIND.CAPTURES),
1361 returned = 22,1334 nofree = @backingInt(ATTR_KIND.NOFREE),
1362 nonnull = 39,1335 nest = @backingInt(ATTR_KIND.NEST),
1363 dereferenceable = 41,1336 returned = @backingInt(ATTR_KIND.RETURNED),
1364 dereferenceable_or_null = 42,1337 nonnull = @backingInt(ATTR_KIND.NON_NULL),
1365 swiftself = 46,1338 dereferenceable = @backingInt(ATTR_KIND.DEREFERENCEABLE),
1366 swiftasync = 75,1339 dereferenceable_or_null = @backingInt(ATTR_KIND.DEREFERENCEABLE_OR_NULL),
1367 swifterror = 47,1340 swiftself = @backingInt(ATTR_KIND.SWIFT_SELF),
1368 immarg = 60,1341 swiftasync = @backingInt(ATTR_KIND.SWIFT_ASYNC),
1369 noundef = 68,1342 swifterror = @backingInt(ATTR_KIND.SWIFT_ERROR),
1370 nofpclass = 87,1343 immarg = @backingInt(ATTR_KIND.IMMARG),
1371 alignstack = 25,1344 noundef = @backingInt(ATTR_KIND.NOUNDEF),
1372 allocalign = 80,1345 nofpclass = @backingInt(ATTR_KIND.NOFPCLASS),
1373 allocptr = 81,1346 alignstack = @backingInt(ATTR_KIND.STACK_ALIGNMENT),
1374 readnone = 20,1347 allocalign = @backingInt(ATTR_KIND.ALLOC_ALIGN),
1375 readonly = 21,1348 allocptr = @backingInt(ATTR_KIND.ALLOCATED_POINTER),
1376 writeonly = 52,1349 readnone = @backingInt(ATTR_KIND.READ_NONE),
1350 readonly = @backingInt(ATTR_KIND.READ_ONLY),
1351 writeonly = @backingInt(ATTR_KIND.WRITEONLY),
1352 writable = @backingInt(ATTR_KIND.WRITABLE),
1353 initializes = @backingInt(ATTR_KIND.INITIALIZES),
1354 dead_on_unwind = @backingInt(ATTR_KIND.DEAD_ON_UNWIND),
1355 dead_on_return = @backingInt(ATTR_KIND.DEAD_ON_RETURN),
1356 range = @backingInt(ATTR_KIND.RANGE),
13771357
1378 // Function Attributes1358 // Function Attributes
1379 //alignstack,1359 //alignstack = @intFromEnum(ATTR_KIND.STACK_ALIGNMENT),
1380 allockind = 82,1360 allockind = @backingInt(ATTR_KIND.ALLOC_KIND),
1381 allocsize = 51,1361 allocsize = @backingInt(ATTR_KIND.ALLOC_SIZE),
1382 alwaysinline = 2,1362 alwaysinline = @backingInt(ATTR_KIND.ALWAYS_INLINE),
1383 builtin = 35,1363 builtin = @backingInt(ATTR_KIND.BUILTIN),
1384 cold = 36,1364 cold = @backingInt(ATTR_KIND.COLD),
1385 convergent = 43,1365 convergent = @backingInt(ATTR_KIND.CONVERGENT),
1386 disable_sanitizer_information = 78,1366 disable_sanitizer_instrumentation = @backingInt(ATTR_KIND.DISABLE_SANITIZER_INSTRUMENTATION),
1387 fn_ret_thunk_extern = 84,1367 fn_ret_thunk_extern = @backingInt(ATTR_KIND.FNRETTHUNK_EXTERN),
1388 hot = 72,1368 hot = @backingInt(ATTR_KIND.HOT),
1389 inlinehint = 4,1369 inlinehint = @backingInt(ATTR_KIND.INLINE_HINT),
1390 jumptable = 40,1370 jumptable = @backingInt(ATTR_KIND.JUMP_TABLE),
1391 memory = 86,1371 memory = @backingInt(ATTR_KIND.MEMORY),
1392 minsize = 6,1372 minsize = @backingInt(ATTR_KIND.MIN_SIZE),
1393 naked = 7,1373 naked = @backingInt(ATTR_KIND.NAKED),
1394 nobuiltin = 10,1374 nobuiltin = @backingInt(ATTR_KIND.NO_BUILTIN),
1395 nocallback = 71,1375 nocallback = @backingInt(ATTR_KIND.NO_CALLBACK),
1396 noduplicate = 12,1376 nodivergencesource = @backingInt(ATTR_KIND.NO_DIVERGENCE_SOURCE),
1397 //nofree,1377 noduplicate = @backingInt(ATTR_KIND.NO_DUPLICATE),
1398 noimplicitfloat = 13,1378 //nofree = @intFromEnum(ATTR_KIND.NOFREE),
1399 @"noinline" = 14,1379 noimplicitfloat = @backingInt(ATTR_KIND.NO_IMPLICIT_FLOAT),
1400 nomerge = 66,1380 @"noinline" = @backingInt(ATTR_KIND.NO_INLINE),
1401 nonlazybind = 15,1381 nomerge = @backingInt(ATTR_KIND.NO_MERGE),
1402 noprofile = 73,1382 nonlazybind = @backingInt(ATTR_KIND.NON_LAZY_BIND),
1403 skipprofile = 85,1383 noprofile = @backingInt(ATTR_KIND.NO_PROFILE),
1404 noredzone = 16,1384 skipprofile = @backingInt(ATTR_KIND.SKIP_PROFILE),
1405 noreturn = 17,1385 noredzone = @backingInt(ATTR_KIND.NO_RED_ZONE),
1406 norecurse = 48,1386 noreturn = @backingInt(ATTR_KIND.NO_RETURN),
1407 willreturn = 61,1387 norecurse = @backingInt(ATTR_KIND.NO_RECURSE),
1408 nosync = 63,1388 willreturn = @backingInt(ATTR_KIND.WILLRETURN),
1409 nounwind = 18,1389 nosync = @backingInt(ATTR_KIND.NOSYNC),
1410 nosanitize_bounds = 79,1390 nounwind = @backingInt(ATTR_KIND.NO_UNWIND),
1411 nosanitize_coverage = 76,1391 nosanitize_bounds = @backingInt(ATTR_KIND.NO_SANITIZE_BOUNDS),
1412 null_pointer_is_valid = 67,1392 nosanitize_coverage = @backingInt(ATTR_KIND.NO_SANITIZE_COVERAGE),
1413 optforfuzzing = 57,1393 null_pointer_is_valid = @backingInt(ATTR_KIND.NULL_POINTER_IS_VALID),
1414 optnone = 37,1394 optdebug = @backingInt(ATTR_KIND.OPTIMIZE_FOR_DEBUGGING),
1415 optsize = 19,1395 optforfuzzing = @backingInt(ATTR_KIND.OPT_FOR_FUZZING),
1416 //preallocated,1396 optnone = @backingInt(ATTR_KIND.OPTIMIZE_NONE),
1417 returns_twice = 23,1397 optsize = @backingInt(ATTR_KIND.OPTIMIZE_FOR_SIZE),
1418 safestack = 44,1398 //preallocated = @intFromEnum(ATTR_KIND.PREALLOCATED),
1419 sanitize_address = 30,1399 returns_twice = @backingInt(ATTR_KIND.RETURNS_TWICE),
1420 sanitize_memory = 32,1400 safestack = @backingInt(ATTR_KIND.SAFESTACK),
1421 sanitize_thread = 31,1401 sanitize_address = @backingInt(ATTR_KIND.SANITIZE_ADDRESS),
1422 sanitize_hwaddress = 55,1402 sanitize_memory = @backingInt(ATTR_KIND.SANITIZE_MEMORY),
1423 sanitize_memtag = 64,1403 sanitize_thread = @backingInt(ATTR_KIND.SANITIZE_THREAD),
1424 speculative_load_hardening = 59,1404 sanitize_hwaddress = @backingInt(ATTR_KIND.SANITIZE_HWADDRESS),
1425 speculatable = 53,1405 sanitize_memtag = @backingInt(ATTR_KIND.SANITIZE_MEMTAG),
1426 ssp = 26,1406 sanitize_realtime = @backingInt(ATTR_KIND.SANITIZE_REALTIME),
1427 sspstrong = 28,1407 sanitize_realtime_blocking = @backingInt(ATTR_KIND.SANITIZE_REALTIME_BLOCKING),
1428 sspreq = 27,1408 sanitize_alloc_token = @backingInt(ATTR_KIND.SANITIZE_ALLOC_TOKEN),
1429 strictfp = 54,1409 speculative_load_hardening = @backingInt(ATTR_KIND.SPECULATIVE_LOAD_HARDENING),
1430 uwtable = 33,1410 speculatable = @backingInt(ATTR_KIND.SPECULATABLE),
1431 nocf_check = 56,1411 ssp = @backingInt(ATTR_KIND.STACK_PROTECT),
1432 shadowcallstack = 58,1412 sspstrong = @backingInt(ATTR_KIND.STACK_PROTECT_STRONG),
1433 mustprogress = 70,1413 sspreq = @backingInt(ATTR_KIND.STACK_PROTECT_REQ),
1434 vscale_range = 74,1414 strictfp = @backingInt(ATTR_KIND.STRICT_FP),
14351415 denormal_fpenv = @backingInt(ATTR_KIND.DENORMAL_FPENV),
1436 // Global Attributes1416 uwtable = @backingInt(ATTR_KIND.UW_TABLE),
1437 no_sanitize_address = 100,1417 nocf_check = @backingInt(ATTR_KIND.NOCF_CHECK),
1438 no_sanitize_hwaddress = 101,1418 shadowcallstack = @backingInt(ATTR_KIND.SHADOWCALLSTACK),
1439 //sanitize_memtag,1419 mustprogress = @backingInt(ATTR_KIND.MUSTPROGRESS),
1440 sanitize_address_dyninit = 102,1420 vscale_range = @backingInt(ATTR_KIND.VSCALE_RANGE),
1421 nooutline = @backingInt(ATTR_KIND.NOOUTLINE),
1422 nocreateundeforpoison = @backingInt(ATTR_KIND.NO_CREATE_UNDEF_OR_POISON),
14411423
1442 string = maxInt(u31),1424 string = maxInt(u31),
1443 none = maxInt(u32),1425 none = maxInt(u32),
...@@ -1447,16 +1429,128 @@ pub const Attribute = union(Kind) {...@@ -1447,16 +1429,128 @@ pub const Attribute = union(Kind) {
14471429
1448 pub fn fromString(str: String) Kind {1430 pub fn fromString(str: String) Kind {
1449 assert(!str.isAnon());1431 assert(!str.isAnon());
1450 const kind: Kind = @fromBackingInt(@intCast(@backingInt(str)));1432 const kind: Kind = @fromBackingInt(@backingInt(str));
1451 assert(kind != .none);1433 assert(kind != .none);
1452 return kind;1434 return kind;
1453 }1435 }
14541436
1455 fn toString(self: Kind) ?String {1437 fn toString(self: Kind) ?String {
1456 assert(self != .none);1438 assert(self != .none);
1457 const str: String = @fromBackingInt(@intCast(@backingInt(self)));1439 const str: String = @fromBackingInt(@backingInt(self));
1458 return if (str.isAnon()) null else str;1440 return if (str.isAnon()) null else str;
1459 }1441 }
1442
1443 /// enum AttributeKindCodes
1444 const ATTR_KIND = enum(u32) {
1445 ALIGNMENT = 1,
1446 ALWAYS_INLINE = 2,
1447 BY_VAL = 3,
1448 INLINE_HINT = 4,
1449 IN_REG = 5,
1450 MIN_SIZE = 6,
1451 NAKED = 7,
1452 NEST = 8,
1453 NO_ALIAS = 9,
1454 NO_BUILTIN = 10,
1455 NO_CAPTURE = 11,
1456 NO_DUPLICATE = 12,
1457 NO_IMPLICIT_FLOAT = 13,
1458 NO_INLINE = 14,
1459 NON_LAZY_BIND = 15,
1460 NO_RED_ZONE = 16,
1461 NO_RETURN = 17,
1462 NO_UNWIND = 18,
1463 OPTIMIZE_FOR_SIZE = 19,
1464 READ_NONE = 20,
1465 READ_ONLY = 21,
1466 RETURNED = 22,
1467 RETURNS_TWICE = 23,
1468 S_EXT = 24,
1469 STACK_ALIGNMENT = 25,
1470 STACK_PROTECT = 26,
1471 STACK_PROTECT_REQ = 27,
1472 STACK_PROTECT_STRONG = 28,
1473 STRUCT_RET = 29,
1474 SANITIZE_ADDRESS = 30,
1475 SANITIZE_THREAD = 31,
1476 SANITIZE_MEMORY = 32,
1477 UW_TABLE = 33,
1478 Z_EXT = 34,
1479 BUILTIN = 35,
1480 COLD = 36,
1481 OPTIMIZE_NONE = 37,
1482 IN_ALLOCA = 38,
1483 NON_NULL = 39,
1484 JUMP_TABLE = 40,
1485 DEREFERENCEABLE = 41,
1486 DEREFERENCEABLE_OR_NULL = 42,
1487 CONVERGENT = 43,
1488 SAFESTACK = 44,
1489 ARGMEMONLY = 45,
1490 SWIFT_SELF = 46,
1491 SWIFT_ERROR = 47,
1492 NO_RECURSE = 48,
1493 INACCESSIBLEMEM_ONLY = 49,
1494 INACCESSIBLEMEM_OR_ARGMEMONLY = 50,
1495 ALLOC_SIZE = 51,
1496 WRITEONLY = 52,
1497 SPECULATABLE = 53,
1498 STRICT_FP = 54,
1499 SANITIZE_HWADDRESS = 55,
1500 NOCF_CHECK = 56,
1501 OPT_FOR_FUZZING = 57,
1502 SHADOWCALLSTACK = 58,
1503 SPECULATIVE_LOAD_HARDENING = 59,
1504 IMMARG = 60,
1505 WILLRETURN = 61,
1506 NOFREE = 62,
1507 NOSYNC = 63,
1508 SANITIZE_MEMTAG = 64,
1509 PREALLOCATED = 65,
1510 NO_MERGE = 66,
1511 NULL_POINTER_IS_VALID = 67,
1512 NOUNDEF = 68,
1513 BYREF = 69,
1514 MUSTPROGRESS = 70,
1515 NO_CALLBACK = 71,
1516 HOT = 72,
1517 NO_PROFILE = 73,
1518 VSCALE_RANGE = 74,
1519 SWIFT_ASYNC = 75,
1520 NO_SANITIZE_COVERAGE = 76,
1521 ELEMENTTYPE = 77,
1522 DISABLE_SANITIZER_INSTRUMENTATION = 78,
1523 NO_SANITIZE_BOUNDS = 79,
1524 ALLOC_ALIGN = 80,
1525 ALLOCATED_POINTER = 81,
1526 ALLOC_KIND = 82,
1527 PRESPLIT_COROUTINE = 83,
1528 FNRETTHUNK_EXTERN = 84,
1529 SKIP_PROFILE = 85,
1530 MEMORY = 86,
1531 NOFPCLASS = 87,
1532 OPTIMIZE_FOR_DEBUGGING = 88,
1533 WRITABLE = 89,
1534 CORO_ONLY_DESTROY_WHEN_COMPLETE = 90,
1535 DEAD_ON_UNWIND = 91,
1536 RANGE = 92,
1537 SANITIZE_NUMERICAL_STABILITY = 93,
1538 INITIALIZES = 94,
1539 HYBRID_PATCHABLE = 95,
1540 SANITIZE_REALTIME = 96,
1541 SANITIZE_REALTIME_BLOCKING = 97,
1542 CORO_ELIDE_SAFE = 98,
1543 NO_EXT = 99,
1544 NO_DIVERGENCE_SOURCE = 100,
1545 SANITIZE_TYPE = 101,
1546 CAPTURES = 102,
1547 DEAD_ON_RETURN = 103,
1548 SANITIZE_ALLOC_TOKEN = 104,
1549 NO_CREATE_UNDEF_OR_POISON = 105,
1550 DENORMAL_FPENV = 106,
1551 NOOUTLINE = 107,
1552 FLATTEN = 108,
1553 };
1460 };1554 };
14611555
1462 pub const FpClass = packed struct(u32) {1556 pub const FpClass = packed struct(u32) {
...@@ -1506,6 +1600,29 @@ pub const Attribute = union(Kind) {...@@ -1506,6 +1600,29 @@ pub const Attribute = union(Kind) {
1506 pub const pnorm = FpClass{ .positive_normal = true };1600 pub const pnorm = FpClass{ .positive_normal = true };
1507 };1601 };
15081602
1603 pub const Captures = packed struct(u32) {
1604 other: Components = .none,
1605 ret: Components = .none,
1606 _: u24 = 0,
1607
1608 pub const none: Captures = .{};
1609
1610 pub const Components = packed struct(u4) {
1611 address_is_null: bool = false,
1612 address: bool = false,
1613 read_provenance: bool = false,
1614 provenance: bool = false,
1615
1616 pub const none: Components = .{};
1617 pub const all: Components = .{
1618 .address_is_null = true,
1619 .address = true,
1620 .read_provenance = true,
1621 .provenance = true,
1622 };
1623 };
1624 };
1625
1509 pub const AllocKind = packed struct(u32) {1626 pub const AllocKind = packed struct(u32) {
1510 alloc: bool,1627 alloc: bool,
1511 realloc: bool,1628 realloc: bool,
...@@ -1582,9 +1699,13 @@ pub const Attribute = union(Kind) {...@@ -1582,9 +1699,13 @@ pub const Attribute = union(Kind) {
1582 void => 0,1699 void => 0,
1583 u32 => value,1700 u32 => value,
1584 Alignment.Lazy, String, Type, UwTable => @backingInt(value),1701 Alignment.Lazy, String, Type, UwTable => @backingInt(value),
1585 AllocKind, AllocSize, FpClass, Memory, VScaleRange => @bitCast(value),1702 AllocKind, AllocSize, Captures, FpClass, Memory, VScaleRange => @bitCast(value),
1586 else => @compileError("bad payload type: " ++ @tagName(tag) ++ @typeName(@TypeOf(value))),1703 else => @compileError("bad payload type: " ++ @tagName(tag) ++ ": " ++ @typeName(@TypeOf(value))),
1587 } },1704 } },
1705 .initializes,
1706 .dead_on_return,
1707 .range,
1708 => @panic("TODO"),
1588 .string => |string_attr| .{1709 .string => |string_attr| .{
1589 .kind = Kind.fromString(string_attr.kind),1710 .kind = Kind.fromString(string_attr.kind),
1590 .value = @backingInt(string_attr.value),1711 .value = @backingInt(string_attr.value),
...@@ -1907,87 +2028,87 @@ pub const AddrSpace = enum(u24) {...@@ -1907,87 +2028,87 @@ pub const AddrSpace = enum(u24) {
19072028
1908 // See llvm/lib/Target/X86/X86.h2029 // See llvm/lib/Target/X86/X86.h
1909 pub const x86 = struct {2030 pub const x86 = struct {
1910 pub const gs: AddrSpace = @fromBackingInt(@intCast(256));2031 pub const gs: AddrSpace = @fromBackingInt(256);
1911 pub const fs: AddrSpace = @fromBackingInt(@intCast(257));2032 pub const fs: AddrSpace = @fromBackingInt(257);
1912 pub const ss: AddrSpace = @fromBackingInt(@intCast(258));2033 pub const ss: AddrSpace = @fromBackingInt(258);
19132034
1914 pub const ptr32_sptr: AddrSpace = @fromBackingInt(@intCast(270));2035 pub const ptr32_sptr: AddrSpace = @fromBackingInt(270);
1915 pub const ptr32_uptr: AddrSpace = @fromBackingInt(@intCast(271));2036 pub const ptr32_uptr: AddrSpace = @fromBackingInt(271);
1916 pub const ptr64: AddrSpace = @fromBackingInt(@intCast(272));2037 pub const ptr64: AddrSpace = @fromBackingInt(272);
1917 };2038 };
1918 pub const x86_64 = x86;2039 pub const x86_64 = x86;
19192040
1920 // See llvm/lib/Target/AVR/AVR.h2041 // See llvm/lib/Target/AVR/AVR.h
1921 pub const avr = struct {2042 pub const avr = struct {
1922 pub const data: AddrSpace = @fromBackingInt(@intCast(0));2043 pub const data: AddrSpace = @fromBackingInt(0);
1923 pub const program: AddrSpace = @fromBackingInt(@intCast(1));2044 pub const program: AddrSpace = @fromBackingInt(1);
1924 pub const program1: AddrSpace = @fromBackingInt(@intCast(2));2045 pub const program1: AddrSpace = @fromBackingInt(2);
1925 pub const program2: AddrSpace = @fromBackingInt(@intCast(3));2046 pub const program2: AddrSpace = @fromBackingInt(3);
1926 pub const program3: AddrSpace = @fromBackingInt(@intCast(4));2047 pub const program3: AddrSpace = @fromBackingInt(4);
1927 pub const program4: AddrSpace = @fromBackingInt(@intCast(5));2048 pub const program4: AddrSpace = @fromBackingInt(5);
1928 pub const program5: AddrSpace = @fromBackingInt(@intCast(6));2049 pub const program5: AddrSpace = @fromBackingInt(6);
1929 };2050 };
19302051
1931 // See llvm/lib/Target/NVPTX/NVPTX.h2052 // See llvm/lib/Target/NVPTX/NVPTX.h
1932 pub const nvptx = struct {2053 pub const nvptx = struct {
1933 pub const generic: AddrSpace = @fromBackingInt(@intCast(0));2054 pub const generic: AddrSpace = @fromBackingInt(0);
1934 pub const global: AddrSpace = @fromBackingInt(@intCast(1));2055 pub const global: AddrSpace = @fromBackingInt(1);
1935 pub const constant: AddrSpace = @fromBackingInt(@intCast(2));2056 pub const constant: AddrSpace = @fromBackingInt(2);
1936 pub const shared: AddrSpace = @fromBackingInt(@intCast(3));2057 pub const shared: AddrSpace = @fromBackingInt(3);
1937 pub const param: AddrSpace = @fromBackingInt(@intCast(4));2058 pub const param: AddrSpace = @fromBackingInt(4);
1938 pub const local: AddrSpace = @fromBackingInt(@intCast(5));2059 pub const local: AddrSpace = @fromBackingInt(5);
1939 };2060 };
19402061
1941 // See llvm/lib/Target/AMDGPU/AMDGPU.h2062 // See llvm/lib/Target/AMDGPU/AMDGPU.h
1942 pub const amdgpu = struct {2063 pub const amdgpu = struct {
1943 pub const flat: AddrSpace = @fromBackingInt(@intCast(0));2064 pub const flat: AddrSpace = @fromBackingInt(0);
1944 pub const global: AddrSpace = @fromBackingInt(@intCast(1));2065 pub const global: AddrSpace = @fromBackingInt(1);
1945 pub const region: AddrSpace = @fromBackingInt(@intCast(2));2066 pub const region: AddrSpace = @fromBackingInt(2);
1946 pub const local: AddrSpace = @fromBackingInt(@intCast(3));2067 pub const local: AddrSpace = @fromBackingInt(3);
1947 pub const constant: AddrSpace = @fromBackingInt(@intCast(4));2068 pub const constant: AddrSpace = @fromBackingInt(4);
1948 pub const private: AddrSpace = @fromBackingInt(@intCast(5));2069 pub const private: AddrSpace = @fromBackingInt(5);
1949 pub const constant_32bit: AddrSpace = @fromBackingInt(@intCast(6));2070 pub const constant_32bit: AddrSpace = @fromBackingInt(6);
1950 pub const buffer_fat_pointer: AddrSpace = @fromBackingInt(@intCast(7));2071 pub const buffer_fat_pointer: AddrSpace = @fromBackingInt(7);
1951 pub const buffer_resource: AddrSpace = @fromBackingInt(@intCast(8));2072 pub const buffer_resource: AddrSpace = @fromBackingInt(8);
1952 pub const buffer_strided_pointer: AddrSpace = @fromBackingInt(@intCast(9));2073 pub const buffer_strided_pointer: AddrSpace = @fromBackingInt(9);
1953 pub const param_d: AddrSpace = @fromBackingInt(@intCast(6));2074 pub const param_d: AddrSpace = @fromBackingInt(6);
1954 pub const param_i: AddrSpace = @fromBackingInt(@intCast(7));2075 pub const param_i: AddrSpace = @fromBackingInt(7);
1955 pub const constant_buffer_0: AddrSpace = @fromBackingInt(@intCast(8));2076 pub const constant_buffer_0: AddrSpace = @fromBackingInt(8);
1956 pub const constant_buffer_1: AddrSpace = @fromBackingInt(@intCast(9));2077 pub const constant_buffer_1: AddrSpace = @fromBackingInt(9);
1957 pub const constant_buffer_2: AddrSpace = @fromBackingInt(@intCast(10));2078 pub const constant_buffer_2: AddrSpace = @fromBackingInt(10);
1958 pub const constant_buffer_3: AddrSpace = @fromBackingInt(@intCast(11));2079 pub const constant_buffer_3: AddrSpace = @fromBackingInt(11);
1959 pub const constant_buffer_4: AddrSpace = @fromBackingInt(@intCast(12));2080 pub const constant_buffer_4: AddrSpace = @fromBackingInt(12);
1960 pub const constant_buffer_5: AddrSpace = @fromBackingInt(@intCast(13));2081 pub const constant_buffer_5: AddrSpace = @fromBackingInt(13);
1961 pub const constant_buffer_6: AddrSpace = @fromBackingInt(@intCast(14));2082 pub const constant_buffer_6: AddrSpace = @fromBackingInt(14);
1962 pub const constant_buffer_7: AddrSpace = @fromBackingInt(@intCast(15));2083 pub const constant_buffer_7: AddrSpace = @fromBackingInt(15);
1963 pub const constant_buffer_8: AddrSpace = @fromBackingInt(@intCast(16));2084 pub const constant_buffer_8: AddrSpace = @fromBackingInt(16);
1964 pub const constant_buffer_9: AddrSpace = @fromBackingInt(@intCast(17));2085 pub const constant_buffer_9: AddrSpace = @fromBackingInt(17);
1965 pub const constant_buffer_10: AddrSpace = @fromBackingInt(@intCast(18));2086 pub const constant_buffer_10: AddrSpace = @fromBackingInt(18);
1966 pub const constant_buffer_11: AddrSpace = @fromBackingInt(@intCast(19));2087 pub const constant_buffer_11: AddrSpace = @fromBackingInt(19);
1967 pub const constant_buffer_12: AddrSpace = @fromBackingInt(@intCast(20));2088 pub const constant_buffer_12: AddrSpace = @fromBackingInt(20);
1968 pub const constant_buffer_13: AddrSpace = @fromBackingInt(@intCast(21));2089 pub const constant_buffer_13: AddrSpace = @fromBackingInt(21);
1969 pub const constant_buffer_14: AddrSpace = @fromBackingInt(@intCast(22));2090 pub const constant_buffer_14: AddrSpace = @fromBackingInt(22);
1970 pub const constant_buffer_15: AddrSpace = @fromBackingInt(@intCast(23));2091 pub const constant_buffer_15: AddrSpace = @fromBackingInt(23);
1971 pub const streamout_register: AddrSpace = @fromBackingInt(@intCast(128));2092 pub const streamout_register: AddrSpace = @fromBackingInt(128);
1972 };2093 };
19732094
1974 pub const spirv = struct {2095 pub const spirv = struct {
1975 pub const function: AddrSpace = @fromBackingInt(@intCast(0));2096 pub const function: AddrSpace = @fromBackingInt(0);
1976 pub const cross_workgroup: AddrSpace = @fromBackingInt(@intCast(1));2097 pub const cross_workgroup: AddrSpace = @fromBackingInt(1);
1977 pub const uniform_constant: AddrSpace = @fromBackingInt(@intCast(2));2098 pub const uniform_constant: AddrSpace = @fromBackingInt(2);
1978 pub const workgroup: AddrSpace = @fromBackingInt(@intCast(3));2099 pub const workgroup: AddrSpace = @fromBackingInt(3);
1979 pub const generic: AddrSpace = @fromBackingInt(@intCast(4));2100 pub const generic: AddrSpace = @fromBackingInt(4);
1980 pub const device_only_intel: AddrSpace = @fromBackingInt(@intCast(5));2101 pub const device_only_intel: AddrSpace = @fromBackingInt(5);
1981 pub const host_only_intel: AddrSpace = @fromBackingInt(@intCast(6));2102 pub const host_only_intel: AddrSpace = @fromBackingInt(6);
1982 pub const input: AddrSpace = @fromBackingInt(@intCast(7));2103 pub const input: AddrSpace = @fromBackingInt(7);
1983 };2104 };
19842105
1985 // See llvm/include/llvm/CodeGen/WasmAddressSpaces.h2106 // See llvm/include/llvm/CodeGen/WasmAddressSpaces.h
1986 pub const wasm = struct {2107 pub const wasm = struct {
1987 pub const default: AddrSpace = @fromBackingInt(@intCast(0));2108 pub const default: AddrSpace = @fromBackingInt(0);
1988 pub const variable: AddrSpace = @fromBackingInt(@intCast(1));2109 pub const variable: AddrSpace = @fromBackingInt(1);
1989 pub const externref: AddrSpace = @fromBackingInt(@intCast(10));2110 pub const externref: AddrSpace = @fromBackingInt(10);
1990 pub const funcref: AddrSpace = @fromBackingInt(@intCast(20));2111 pub const funcref: AddrSpace = @fromBackingInt(20);
1991 };2112 };
19922113
1993 pub fn format(addr_space: AddrSpace, w: *Writer) Writer.Error!void {2114 pub fn format(addr_space: AddrSpace, w: *Writer) Writer.Error!void {
...@@ -2030,7 +2151,7 @@ pub const Alignment = enum(u6) {...@@ -2030,7 +2151,7 @@ pub const Alignment = enum(u6) {
2030 _,2151 _,
20312152
2032 pub fn wrap(a: Alignment) Lazy {2153 pub fn wrap(a: Alignment) Lazy {
2033 return @fromBackingInt(@intCast(@backingInt(a)));2154 return @fromBackingInt(@backingInt(a));
2034 }2155 }
2035 pub fn resolve(l: Lazy, b: *const Builder) Alignment {2156 pub fn resolve(l: Lazy, b: *const Builder) Alignment {
2036 return switch (@backingInt(l)) {2157 return switch (@backingInt(l)) {
...@@ -2261,8 +2382,7 @@ pub const StrtabString = enum(u32) {...@@ -2261,8 +2382,7 @@ pub const StrtabString = enum(u32) {
2261 }2382 }
22622383
2263 fn fromIndex(index: ?usize) StrtabString {2384 fn fromIndex(index: ?usize) StrtabString {
2264 return @fromBackingInt(@intCast(@as(u32, @intCast((index orelse return .none) +2385 return @fromBackingInt(@intCast((index orelse return .none) + @backingInt(StrtabString.empty)));
2265 @backingInt(StrtabString.empty)))));
2266 }2386 }
22672387
2268 fn toIndex(self: StrtabString) ?usize {2388 fn toIndex(self: StrtabString) ?usize {
...@@ -2398,7 +2518,7 @@ pub const Global = struct {...@@ -2398,7 +2518,7 @@ pub const Global = struct {
2398 }2518 }
23992519
2400 pub fn toConst(global: Index) Constant {2520 pub fn toConst(global: Index) Constant {
2401 return @fromBackingInt(@intCast(@backingInt(Constant.first_global) + @backingInt(global)));2521 return @fromBackingInt(@backingInt(Constant.first_global) + @backingInt(global));
2402 }2522 }
24032523
2404 pub fn toValue(global: Index) Value {2524 pub fn toValue(global: Index) Value {
...@@ -2526,7 +2646,7 @@ pub const Global = struct {...@@ -2526,7 +2646,7 @@ pub const Global = struct {
2526 _ = builder.addGlobalAssumeCapacity(new_name, builder.globals.values()[index]);2646 _ = builder.addGlobalAssumeCapacity(new_name, builder.globals.values()[index]);
2527 builder.globals.swapRemoveAt(index);2647 builder.globals.swapRemoveAt(index);
2528 if (!old_name.isAnon()) return;2648 if (!old_name.isAnon()) return;
2529 builder.next_unnamed_global = @fromBackingInt(@intCast(@backingInt(builder.next_unnamed_global) - 1));2649 builder.next_unnamed_global = @fromBackingInt(@backingInt(builder.next_unnamed_global) - 1);
2530 if (builder.next_unnamed_global == old_name) return;2650 if (builder.next_unnamed_global == old_name) return;
2531 builder.getGlobal(builder.next_unnamed_global).?.renameAssumeCapacity(old_name, builder);2651 builder.getGlobal(builder.next_unnamed_global).?.renameAssumeCapacity(old_name, builder);
2532 }2652 }
...@@ -2539,7 +2659,7 @@ pub const Global = struct {...@@ -2539,7 +2659,7 @@ pub const Global = struct {
25392659
2540 fn replaceAssumeCapacity(self: Index, other: Index, builder: *Builder) void {2660 fn replaceAssumeCapacity(self: Index, other: Index, builder: *Builder) void {
2541 if (self.eql(other, builder)) return;2661 if (self.eql(other, builder)) return;
2542 builder.next_replaced_global = @fromBackingInt(@intCast(@backingInt(builder.next_replaced_global) - 1));2662 builder.next_replaced_global = @fromBackingInt(@backingInt(builder.next_replaced_global) - 1);
2543 self.renameAssumeCapacity(builder.next_replaced_global, builder);2663 self.renameAssumeCapacity(builder.next_replaced_global, builder);
2544 self.ptr(builder).kind = .{ .replaced = other.unwrap(builder) };2664 self.ptr(builder).kind = .{ .replaced = other.unwrap(builder) };
2545 }2665 }
...@@ -2699,6 +2819,8 @@ pub const Intrinsic = enum {...@@ -2699,6 +2819,8 @@ pub const Intrinsic = enum {
2699 smin,2819 smin,
2700 umax,2820 umax,
2701 umin,2821 umin,
2822 scmp,
2823 ucmp,
2702 memcpy,2824 memcpy,
2703 @"memcpy.inline",2825 @"memcpy.inline",
2704 memmove,2826 memmove,
...@@ -2708,10 +2830,21 @@ pub const Intrinsic = enum {...@@ -2708,10 +2830,21 @@ pub const Intrinsic = enum {
2708 powi,2830 powi,
2709 sin,2831 sin,
2710 cos,2832 cos,
2833 tan,
2834 asin,
2835 acos,
2836 atan,
2837 atan2,
2838 sinh,
2839 cosh,
2840 tanh,
2841 sincos,
2842 sincospi,
2843 modf,
2711 pow,2844 pow,
2712 exp,2845 exp,
2713 exp10,
2714 exp2,2846 exp2,
2847 exp10,
2715 ldexp,2848 ldexp,
2716 frexp,2849 frexp,
2717 log,2850 log,
...@@ -2723,6 +2856,8 @@ pub const Intrinsic = enum {...@@ -2723,6 +2856,8 @@ pub const Intrinsic = enum {
2723 maxnum,2856 maxnum,
2724 minimum,2857 minimum,
2725 maximum,2858 maximum,
2859 minimumnum,
2860 maximumnum,
2726 copysign,2861 copysign,
2727 floor,2862 floor,
2728 ceil,2863 ceil,
...@@ -2744,6 +2879,7 @@ pub const Intrinsic = enum {...@@ -2744,6 +2879,7 @@ pub const Intrinsic = enum {
2744 cttz,2879 cttz,
2745 fshl,2880 fshl,
2746 fshr,2881 fshr,
2882 clmul,
27472883
2748 // Arithmetic with Overflow2884 // Arithmetic with Overflow
2749 @"sadd.with.overflow",2885 @"sadd.with.overflow",
...@@ -2904,21 +3040,21 @@ pub const Intrinsic = enum {...@@ -2904,21 +3040,21 @@ pub const Intrinsic = enum {
2904 .{ .kind = .{ .type = .ptr } },3040 .{ .kind = .{ .type = .ptr } },
2905 .{ .kind = .{ .type = .i32 }, .attrs = &.{.immarg} },3041 .{ .kind = .{ .type = .i32 }, .attrs = &.{.immarg} },
2906 },3042 },
2907 .attrs = &.{ .nocallback, .nofree, .nosync, .nounwind, .willreturn, .{ .memory = Attribute.Memory.all(.none) } },3043 .attrs = &.{ .nocallback, .nofree, .nosync, .nounwind, .willreturn, .{ .memory = .all(.none) } },
2908 },3044 },
2909 .addressofreturnaddress = .{3045 .addressofreturnaddress = .{
2910 .ret_len = 1,3046 .ret_len = 1,
2911 .params = &.{3047 .params = &.{
2912 .{ .kind = .overloaded },3048 .{ .kind = .overloaded },
2913 },3049 },
2914 .attrs = &.{ .nocallback, .nofree, .nosync, .nounwind, .willreturn, .{ .memory = Attribute.Memory.all(.none) } },3050 .attrs = &.{ .nocallback, .nofree, .nosync, .nounwind, .willreturn, .{ .memory = .all(.none) } },
2915 },3051 },
2916 .sponentry = .{3052 .sponentry = .{
2917 .ret_len = 1,3053 .ret_len = 1,
2918 .params = &.{3054 .params = &.{
2919 .{ .kind = .overloaded },3055 .{ .kind = .overloaded },
2920 },3056 },
2921 .attrs = &.{ .nocallback, .nofree, .nosync, .nounwind, .willreturn, .{ .memory = Attribute.Memory.all(.none) } },3057 .attrs = &.{ .nocallback, .nofree, .nosync, .nounwind, .willreturn, .{ .memory = .all(.none) } },
2922 },3058 },
2923 .frameaddress = .{3059 .frameaddress = .{
2924 .ret_len = 1,3060 .ret_len = 1,
...@@ -2926,7 +3062,7 @@ pub const Intrinsic = enum {...@@ -2926,7 +3062,7 @@ pub const Intrinsic = enum {
2926 .{ .kind = .overloaded },3062 .{ .kind = .overloaded },
2927 .{ .kind = .{ .type = .i32 }, .attrs = &.{.immarg} },3063 .{ .kind = .{ .type = .i32 }, .attrs = &.{.immarg} },
2928 },3064 },
2929 .attrs = &.{ .nocallback, .nofree, .nosync, .nounwind, .willreturn, .{ .memory = Attribute.Memory.all(.none) } },3065 .attrs = &.{ .nocallback, .nofree, .nosync, .nounwind, .willreturn, .{ .memory = .all(.none) } },
2930 },3066 },
2931 .prefetch = .{3067 .prefetch = .{
2932 .ret_len = 0,3068 .ret_len = 0,
...@@ -2936,14 +3072,14 @@ pub const Intrinsic = enum {...@@ -2936,14 +3072,14 @@ pub const Intrinsic = enum {
2936 .{ .kind = .{ .type = .i32 }, .attrs = &.{.immarg} },3072 .{ .kind = .{ .type = .i32 }, .attrs = &.{.immarg} },
2937 .{ .kind = .{ .type = .i32 }, .attrs = &.{.immarg} },3073 .{ .kind = .{ .type = .i32 }, .attrs = &.{.immarg} },
2938 },3074 },
2939 .attrs = &.{ .nocallback, .nofree, .nosync, .nounwind, .willreturn, .{ .memory = Attribute.Memory.all(.readwrite) } },3075 .attrs = &.{ .nocallback, .nofree, .nosync, .nounwind, .willreturn, .{ .memory = .all(.readwrite) } },
2940 },3076 },
2941 .@"thread.pointer" = .{3077 .@"thread.pointer" = .{
2942 .ret_len = 1,3078 .ret_len = 1,
2943 .params = &.{3079 .params = &.{
2944 .{ .kind = .{ .type = .ptr } },3080 .{ .kind = .{ .type = .ptr } },
2945 },3081 },
2946 .attrs = &.{ .nocallback, .nofree, .nosync, .nounwind, .willreturn, .{ .memory = Attribute.Memory.all(.none) } },3082 .attrs = &.{ .nocallback, .nofree, .nosync, .nounwind, .willreturn, .{ .memory = .all(.none) } },
2947 },3083 },
29483084
2949 .abs = .{3085 .abs = .{
...@@ -2953,7 +3089,7 @@ pub const Intrinsic = enum {...@@ -2953,7 +3089,7 @@ pub const Intrinsic = enum {
2953 .{ .kind = .{ .matches = 0 } },3089 .{ .kind = .{ .matches = 0 } },
2954 .{ .kind = .{ .type = .i1 }, .attrs = &.{.immarg} },3090 .{ .kind = .{ .type = .i1 }, .attrs = &.{.immarg} },
2955 },3091 },
2956 .attrs = &.{ .nocallback, .nofree, .nosync, .nounwind, .speculatable, .willreturn, .{ .memory = Attribute.Memory.all(.none) } },3092 .attrs = &.{ .nocallback, .nofree, .nosync, .nounwind, .speculatable, .willreturn, .{ .memory = .all(.none) } },
2957 },3093 },
2958 .smax = .{3094 .smax = .{
2959 .ret_len = 1,3095 .ret_len = 1,
...@@ -2962,7 +3098,7 @@ pub const Intrinsic = enum {...@@ -2962,7 +3098,7 @@ pub const Intrinsic = enum {
2962 .{ .kind = .{ .matches = 0 } },3098 .{ .kind = .{ .matches = 0 } },
2963 .{ .kind = .{ .matches = 0 } },3099 .{ .kind = .{ .matches = 0 } },
2964 },3100 },
2965 .attrs = &.{ .nocallback, .nofree, .nosync, .nounwind, .speculatable, .willreturn, .{ .memory = Attribute.Memory.all(.none) } },3101 .attrs = &.{ .nocallback, .nocreateundeforpoison, .nofree, .nosync, .nounwind, .speculatable, .willreturn, .{ .memory = .all(.none) } },
2966 },3102 },
2967 .smin = .{3103 .smin = .{
2968 .ret_len = 1,3104 .ret_len = 1,
...@@ -2971,7 +3107,7 @@ pub const Intrinsic = enum {...@@ -2971,7 +3107,7 @@ pub const Intrinsic = enum {
2971 .{ .kind = .{ .matches = 0 } },3107 .{ .kind = .{ .matches = 0 } },
2972 .{ .kind = .{ .matches = 0 } },3108 .{ .kind = .{ .matches = 0 } },
2973 },3109 },
2974 .attrs = &.{ .nocallback, .nofree, .nosync, .nounwind, .speculatable, .willreturn, .{ .memory = Attribute.Memory.all(.none) } },3110 .attrs = &.{ .nocallback, .nocreateundeforpoison, .nofree, .nosync, .nounwind, .speculatable, .willreturn, .{ .memory = .all(.none) } },
2975 },3111 },
2976 .umax = .{3112 .umax = .{
2977 .ret_len = 1,3113 .ret_len = 1,
...@@ -2980,7 +3116,7 @@ pub const Intrinsic = enum {...@@ -2980,7 +3116,7 @@ pub const Intrinsic = enum {
2980 .{ .kind = .{ .matches = 0 } },3116 .{ .kind = .{ .matches = 0 } },
2981 .{ .kind = .{ .matches = 0 } },3117 .{ .kind = .{ .matches = 0 } },
2982 },3118 },
2983 .attrs = &.{ .nocallback, .nofree, .nosync, .nounwind, .speculatable, .willreturn, .{ .memory = Attribute.Memory.all(.none) } },3119 .attrs = &.{ .nocallback, .nocreateundeforpoison, .nofree, .nosync, .nounwind, .speculatable, .willreturn, .{ .memory = .all(.none) } },
2984 },3120 },
2985 .umin = .{3121 .umin = .{
2986 .ret_len = 1,3122 .ret_len = 1,
...@@ -2989,7 +3125,25 @@ pub const Intrinsic = enum {...@@ -2989,7 +3125,25 @@ pub const Intrinsic = enum {
2989 .{ .kind = .{ .matches = 0 } },3125 .{ .kind = .{ .matches = 0 } },
2990 .{ .kind = .{ .matches = 0 } },3126 .{ .kind = .{ .matches = 0 } },
2991 },3127 },
2992 .attrs = &.{ .nocallback, .nofree, .nosync, .nounwind, .speculatable, .willreturn, .{ .memory = Attribute.Memory.all(.none) } },3128 .attrs = &.{ .nocallback, .nocreateundeforpoison, .nofree, .nosync, .nounwind, .speculatable, .willreturn, .{ .memory = .all(.none) } },
3129 },
3130 .scmp = .{
3131 .ret_len = 1,
3132 .params = &.{
3133 .{ .kind = .overloaded },
3134 .{ .kind = .overloaded },
3135 .{ .kind = .{ .matches = 1 } },
3136 },
3137 .attrs = &.{ .nocallback, .nocreateundeforpoison, .nofree, .nosync, .nounwind, .speculatable, .willreturn, .{ .memory = .all(.none) } },
3138 },
3139 .ucmp = .{
3140 .ret_len = 1,
3141 .params = &.{
3142 .{ .kind = .overloaded },
3143 .{ .kind = .overloaded },
3144 .{ .kind = .{ .matches = 1 } },
3145 },
3146 .attrs = &.{ .nocallback, .nocreateundeforpoison, .nofree, .nosync, .nounwind, .speculatable, .willreturn, .{ .memory = .all(.none) } },
2993 },3147 },
2994 .memcpy = .{3148 .memcpy = .{
2995 .ret_len = 0,3149 .ret_len = 0,
...@@ -3047,7 +3201,7 @@ pub const Intrinsic = enum {...@@ -3047,7 +3201,7 @@ pub const Intrinsic = enum {
3047 .{ .kind = .overloaded },3201 .{ .kind = .overloaded },
3048 .{ .kind = .{ .matches = 0 } },3202 .{ .kind = .{ .matches = 0 } },
3049 },3203 },
3050 .attrs = &.{ .nocallback, .nofree, .nosync, .nounwind, .speculatable, .willreturn, .{ .memory = Attribute.Memory.all(.none) } },3204 .attrs = &.{ .nocallback, .nofree, .nosync, .nounwind, .speculatable, .willreturn, .{ .memory = .all(.none) } },
3051 },3205 },
3052 .powi = .{3206 .powi = .{
3053 .ret_len = 1,3207 .ret_len = 1,
...@@ -3056,7 +3210,7 @@ pub const Intrinsic = enum {...@@ -3056,7 +3210,7 @@ pub const Intrinsic = enum {
3056 .{ .kind = .{ .matches = 0 } },3210 .{ .kind = .{ .matches = 0 } },
3057 .{ .kind = .overloaded },3211 .{ .kind = .overloaded },
3058 },3212 },
3059 .attrs = &.{ .nocallback, .nofree, .nosync, .nounwind, .speculatable, .willreturn, .{ .memory = Attribute.Memory.all(.none) } },3213 .attrs = &.{ .nocallback, .nofree, .nosync, .nounwind, .speculatable, .willreturn, .{ .memory = .all(.none) } },
3060 },3214 },
3061 .sin = .{3215 .sin = .{
3062 .ret_len = 1,3216 .ret_len = 1,
...@@ -3064,7 +3218,7 @@ pub const Intrinsic = enum {...@@ -3064,7 +3218,7 @@ pub const Intrinsic = enum {
3064 .{ .kind = .overloaded },3218 .{ .kind = .overloaded },
3065 .{ .kind = .{ .matches = 0 } },3219 .{ .kind = .{ .matches = 0 } },
3066 },3220 },
3067 .attrs = &.{ .nocallback, .nofree, .nosync, .nounwind, .speculatable, .willreturn, .{ .memory = Attribute.Memory.all(.none) } },3221 .attrs = &.{ .nocallback, .nocreateundeforpoison, .nofree, .nosync, .nounwind, .speculatable, .willreturn, .{ .memory = .all(.none) } },
3068 },3222 },
3069 .cos = .{3223 .cos = .{
3070 .ret_len = 1,3224 .ret_len = 1,
...@@ -3072,7 +3226,99 @@ pub const Intrinsic = enum {...@@ -3072,7 +3226,99 @@ pub const Intrinsic = enum {
3072 .{ .kind = .overloaded },3226 .{ .kind = .overloaded },
3073 .{ .kind = .{ .matches = 0 } },3227 .{ .kind = .{ .matches = 0 } },
3074 },3228 },
3075 .attrs = &.{ .nocallback, .nofree, .nosync, .nounwind, .speculatable, .willreturn, .{ .memory = Attribute.Memory.all(.none) } },3229 .attrs = &.{ .nocallback, .nocreateundeforpoison, .nofree, .nosync, .nounwind, .speculatable, .willreturn, .{ .memory = .all(.none) } },
3230 },
3231 .tan = .{
3232 .ret_len = 1,
3233 .params = &.{
3234 .{ .kind = .overloaded },
3235 .{ .kind = .{ .matches = 0 } },
3236 },
3237 .attrs = &.{ .nocallback, .nofree, .nosync, .nounwind, .speculatable, .willreturn, .{ .memory = .all(.none) } },
3238 },
3239 .asin = .{
3240 .ret_len = 1,
3241 .params = &.{
3242 .{ .kind = .overloaded },
3243 .{ .kind = .{ .matches = 0 } },
3244 },
3245 .attrs = &.{ .nocallback, .nofree, .nosync, .nounwind, .speculatable, .willreturn, .{ .memory = .all(.none) } },
3246 },
3247 .acos = .{
3248 .ret_len = 1,
3249 .params = &.{
3250 .{ .kind = .overloaded },
3251 .{ .kind = .{ .matches = 0 } },
3252 },
3253 .attrs = &.{ .nocallback, .nofree, .nosync, .nounwind, .speculatable, .willreturn, .{ .memory = .all(.none) } },
3254 },
3255 .atan = .{
3256 .ret_len = 1,
3257 .params = &.{
3258 .{ .kind = .overloaded },
3259 .{ .kind = .{ .matches = 0 } },
3260 },
3261 .attrs = &.{ .nocallback, .nofree, .nosync, .nounwind, .speculatable, .willreturn, .{ .memory = .all(.none) } },
3262 },
3263 .atan2 = .{
3264 .ret_len = 1,
3265 .params = &.{
3266 .{ .kind = .overloaded },
3267 .{ .kind = .{ .matches = 0 } },
3268 .{ .kind = .{ .matches = 0 } },
3269 },
3270 .attrs = &.{ .nocallback, .nofree, .nosync, .nounwind, .speculatable, .willreturn, .{ .memory = .all(.none) } },
3271 },
3272 .sinh = .{
3273 .ret_len = 1,
3274 .params = &.{
3275 .{ .kind = .overloaded },
3276 .{ .kind = .{ .matches = 0 } },
3277 },
3278 .attrs = &.{ .nocallback, .nofree, .nosync, .nounwind, .speculatable, .willreturn, .{ .memory = .all(.none) } },
3279 },
3280 .cosh = .{
3281 .ret_len = 1,
3282 .params = &.{
3283 .{ .kind = .overloaded },
3284 .{ .kind = .{ .matches = 0 } },
3285 },
3286 .attrs = &.{ .nocallback, .nofree, .nosync, .nounwind, .speculatable, .willreturn, .{ .memory = .all(.none) } },
3287 },
3288 .tanh = .{
3289 .ret_len = 1,
3290 .params = &.{
3291 .{ .kind = .overloaded },
3292 .{ .kind = .{ .matches = 0 } },
3293 },
3294 .attrs = &.{ .nocallback, .nofree, .nosync, .nounwind, .speculatable, .willreturn, .{ .memory = .all(.none) } },
3295 },
3296 .sincos = .{
3297 .ret_len = 2,
3298 .params = &.{
3299 .{ .kind = .overloaded },
3300 .{ .kind = .{ .matches = 0 } },
3301 .{ .kind = .{ .matches = 0 } },
3302 },
3303 .attrs = &.{ .nocallback, .nofree, .nosync, .nounwind, .speculatable, .willreturn, .{ .memory = .all(.none) } },
3304 },
3305 .sincospi = .{
3306 .ret_len = 2,
3307 .params = &.{
3308 .{ .kind = .overloaded },
3309 .{ .kind = .{ .matches = 0 } },
3310 .{ .kind = .{ .matches = 0 } },
3311 },
3312 .attrs = &.{ .nocallback, .nofree, .nosync, .nounwind, .speculatable, .willreturn, .{ .memory = .all(.none) } },
3313 },
3314 .modf = .{
3315 .ret_len = 2,
3316 .params = &.{
3317 .{ .kind = .overloaded },
3318 .{ .kind = .{ .matches = 0 } },
3319 .{ .kind = .{ .matches = 0 } },
3320 },
3321 .attrs = &.{ .nocallback, .nofree, .nosync, .nounwind, .speculatable, .willreturn, .{ .memory = .all(.none) } },
3076 },3322 },
3077 .pow = .{3323 .pow = .{
3078 .ret_len = 1,3324 .ret_len = 1,
...@@ -3081,7 +3327,7 @@ pub const Intrinsic = enum {...@@ -3081,7 +3327,7 @@ pub const Intrinsic = enum {
3081 .{ .kind = .{ .matches = 0 } },3327 .{ .kind = .{ .matches = 0 } },
3082 .{ .kind = .{ .matches = 0 } },3328 .{ .kind = .{ .matches = 0 } },
3083 },3329 },
3084 .attrs = &.{ .nocallback, .nofree, .nosync, .nounwind, .speculatable, .willreturn, .{ .memory = Attribute.Memory.all(.none) } },3330 .attrs = &.{ .nocallback, .nocreateundeforpoison, .nofree, .nosync, .nounwind, .speculatable, .willreturn, .{ .memory = .all(.none) } },
3085 },3331 },
3086 .exp = .{3332 .exp = .{
3087 .ret_len = 1,3333 .ret_len = 1,
...@@ -3089,7 +3335,7 @@ pub const Intrinsic = enum {...@@ -3089,7 +3335,7 @@ pub const Intrinsic = enum {
3089 .{ .kind = .overloaded },3335 .{ .kind = .overloaded },
3090 .{ .kind = .{ .matches = 0 } },3336 .{ .kind = .{ .matches = 0 } },
3091 },3337 },
3092 .attrs = &.{ .nocallback, .nofree, .nosync, .nounwind, .speculatable, .willreturn, .{ .memory = Attribute.Memory.all(.none) } },3338 .attrs = &.{ .nocallback, .nocreateundeforpoison, .nofree, .nosync, .nounwind, .speculatable, .willreturn, .{ .memory = .all(.none) } },
3093 },3339 },
3094 .exp2 = .{3340 .exp2 = .{
3095 .ret_len = 1,3341 .ret_len = 1,
...@@ -3097,7 +3343,7 @@ pub const Intrinsic = enum {...@@ -3097,7 +3343,7 @@ pub const Intrinsic = enum {
3097 .{ .kind = .overloaded },3343 .{ .kind = .overloaded },
3098 .{ .kind = .{ .matches = 0 } },3344 .{ .kind = .{ .matches = 0 } },
3099 },3345 },
3100 .attrs = &.{ .nocallback, .nofree, .nosync, .nounwind, .speculatable, .willreturn, .{ .memory = Attribute.Memory.all(.none) } },3346 .attrs = &.{ .nocallback, .nocreateundeforpoison, .nofree, .nosync, .nounwind, .speculatable, .willreturn, .{ .memory = .all(.none) } },
3101 },3347 },
3102 .exp10 = .{3348 .exp10 = .{
3103 .ret_len = 1,3349 .ret_len = 1,
...@@ -3105,7 +3351,7 @@ pub const Intrinsic = enum {...@@ -3105,7 +3351,7 @@ pub const Intrinsic = enum {
3105 .{ .kind = .overloaded },3351 .{ .kind = .overloaded },
3106 .{ .kind = .{ .matches = 0 } },3352 .{ .kind = .{ .matches = 0 } },
3107 },3353 },
3108 .attrs = &.{ .nocallback, .nofree, .nosync, .nounwind, .speculatable, .willreturn, .{ .memory = Attribute.Memory.all(.none) } },3354 .attrs = &.{ .nocallback, .nocreateundeforpoison, .nofree, .nosync, .nounwind, .speculatable, .willreturn, .{ .memory = .all(.none) } },
3109 },3355 },
3110 .ldexp = .{3356 .ldexp = .{
3111 .ret_len = 1,3357 .ret_len = 1,
...@@ -3114,7 +3360,7 @@ pub const Intrinsic = enum {...@@ -3114,7 +3360,7 @@ pub const Intrinsic = enum {
3114 .{ .kind = .{ .matches = 0 } },3360 .{ .kind = .{ .matches = 0 } },
3115 .{ .kind = .overloaded },3361 .{ .kind = .overloaded },
3116 },3362 },
3117 .attrs = &.{ .nocallback, .nofree, .nosync, .nounwind, .speculatable, .willreturn, .{ .memory = Attribute.Memory.all(.none) } },3363 .attrs = &.{ .nocallback, .nocreateundeforpoison, .nofree, .nosync, .nounwind, .speculatable, .willreturn, .{ .memory = .all(.none) } },
3118 },3364 },
3119 .frexp = .{3365 .frexp = .{
3120 .ret_len = 2,3366 .ret_len = 2,
...@@ -3123,7 +3369,7 @@ pub const Intrinsic = enum {...@@ -3123,7 +3369,7 @@ pub const Intrinsic = enum {
3123 .{ .kind = .overloaded },3369 .{ .kind = .overloaded },
3124 .{ .kind = .{ .matches = 0 } },3370 .{ .kind = .{ .matches = 0 } },
3125 },3371 },
3126 .attrs = &.{ .nocallback, .nofree, .nosync, .nounwind, .speculatable, .willreturn, .{ .memory = Attribute.Memory.all(.none) } },3372 .attrs = &.{ .nocallback, .nocreateundeforpoison, .nofree, .nosync, .nounwind, .speculatable, .willreturn, .{ .memory = .all(.none) } },
3127 },3373 },
3128 .log = .{3374 .log = .{
3129 .ret_len = 1,3375 .ret_len = 1,
...@@ -3131,7 +3377,7 @@ pub const Intrinsic = enum {...@@ -3131,7 +3377,7 @@ pub const Intrinsic = enum {
3131 .{ .kind = .overloaded },3377 .{ .kind = .overloaded },
3132 .{ .kind = .{ .matches = 0 } },3378 .{ .kind = .{ .matches = 0 } },
3133 },3379 },
3134 .attrs = &.{ .nocallback, .nofree, .nosync, .nounwind, .speculatable, .willreturn, .{ .memory = Attribute.Memory.all(.none) } },3380 .attrs = &.{ .nocallback, .nocreateundeforpoison, .nofree, .nosync, .nounwind, .speculatable, .willreturn, .{ .memory = .all(.none) } },
3135 },3381 },
3136 .log10 = .{3382 .log10 = .{
3137 .ret_len = 1,3383 .ret_len = 1,
...@@ -3139,7 +3385,7 @@ pub const Intrinsic = enum {...@@ -3139,7 +3385,7 @@ pub const Intrinsic = enum {
3139 .{ .kind = .overloaded },3385 .{ .kind = .overloaded },
3140 .{ .kind = .{ .matches = 0 } },3386 .{ .kind = .{ .matches = 0 } },
3141 },3387 },
3142 .attrs = &.{ .nocallback, .nofree, .nosync, .nounwind, .speculatable, .willreturn, .{ .memory = Attribute.Memory.all(.none) } },3388 .attrs = &.{ .nocallback, .nocreateundeforpoison, .nofree, .nosync, .nounwind, .speculatable, .willreturn, .{ .memory = .all(.none) } },
3143 },3389 },
3144 .log2 = .{3390 .log2 = .{
3145 .ret_len = 1,3391 .ret_len = 1,
...@@ -3147,7 +3393,7 @@ pub const Intrinsic = enum {...@@ -3147,7 +3393,7 @@ pub const Intrinsic = enum {
3147 .{ .kind = .overloaded },3393 .{ .kind = .overloaded },
3148 .{ .kind = .{ .matches = 0 } },3394 .{ .kind = .{ .matches = 0 } },
3149 },3395 },
3150 .attrs = &.{ .nocallback, .nofree, .nosync, .nounwind, .speculatable, .willreturn, .{ .memory = Attribute.Memory.all(.none) } },3396 .attrs = &.{ .nocallback, .nocreateundeforpoison, .nofree, .nosync, .nounwind, .speculatable, .willreturn, .{ .memory = .all(.none) } },
3151 },3397 },
3152 .fma = .{3398 .fma = .{
3153 .ret_len = 1,3399 .ret_len = 1,
...@@ -3157,7 +3403,7 @@ pub const Intrinsic = enum {...@@ -3157,7 +3403,7 @@ pub const Intrinsic = enum {
3157 .{ .kind = .{ .matches = 0 } },3403 .{ .kind = .{ .matches = 0 } },
3158 .{ .kind = .{ .matches = 0 } },3404 .{ .kind = .{ .matches = 0 } },
3159 },3405 },
3160 .attrs = &.{ .nocallback, .nofree, .nosync, .nounwind, .speculatable, .willreturn, .{ .memory = Attribute.Memory.all(.none) } },3406 .attrs = &.{ .nocallback, .nocreateundeforpoison, .nofree, .nosync, .nounwind, .speculatable, .willreturn, .{ .memory = .all(.none) } },
3161 },3407 },
3162 .fabs = .{3408 .fabs = .{
3163 .ret_len = 1,3409 .ret_len = 1,
...@@ -3165,7 +3411,7 @@ pub const Intrinsic = enum {...@@ -3165,7 +3411,7 @@ pub const Intrinsic = enum {
3165 .{ .kind = .overloaded },3411 .{ .kind = .overloaded },
3166 .{ .kind = .{ .matches = 0 } },3412 .{ .kind = .{ .matches = 0 } },
3167 },3413 },
3168 .attrs = &.{ .nocallback, .nofree, .nosync, .nounwind, .speculatable, .willreturn, .{ .memory = Attribute.Memory.all(.none) } },3414 .attrs = &.{ .nocallback, .nocreateundeforpoison, .nofree, .nosync, .nounwind, .speculatable, .willreturn, .{ .memory = .all(.none) } },
3169 },3415 },
3170 .minnum = .{3416 .minnum = .{
3171 .ret_len = 1,3417 .ret_len = 1,
...@@ -3174,7 +3420,7 @@ pub const Intrinsic = enum {...@@ -3174,7 +3420,7 @@ pub const Intrinsic = enum {
3174 .{ .kind = .{ .matches = 0 } },3420 .{ .kind = .{ .matches = 0 } },
3175 .{ .kind = .{ .matches = 0 } },3421 .{ .kind = .{ .matches = 0 } },
3176 },3422 },
3177 .attrs = &.{ .nocallback, .nofree, .nosync, .nounwind, .speculatable, .willreturn, .{ .memory = Attribute.Memory.all(.none) } },3423 .attrs = &.{ .nocallback, .nocreateundeforpoison, .nofree, .nosync, .nounwind, .speculatable, .willreturn, .{ .memory = .all(.none) } },
3178 },3424 },
3179 .maxnum = .{3425 .maxnum = .{
3180 .ret_len = 1,3426 .ret_len = 1,
...@@ -3183,7 +3429,7 @@ pub const Intrinsic = enum {...@@ -3183,7 +3429,7 @@ pub const Intrinsic = enum {
3183 .{ .kind = .{ .matches = 0 } },3429 .{ .kind = .{ .matches = 0 } },
3184 .{ .kind = .{ .matches = 0 } },3430 .{ .kind = .{ .matches = 0 } },
3185 },3431 },
3186 .attrs = &.{ .nocallback, .nofree, .nosync, .nounwind, .speculatable, .willreturn, .{ .memory = Attribute.Memory.all(.none) } },3432 .attrs = &.{ .nocallback, .nocreateundeforpoison, .nofree, .nosync, .nounwind, .speculatable, .willreturn, .{ .memory = .all(.none) } },
3187 },3433 },
3188 .minimum = .{3434 .minimum = .{
3189 .ret_len = 1,3435 .ret_len = 1,
...@@ -3192,7 +3438,7 @@ pub const Intrinsic = enum {...@@ -3192,7 +3438,7 @@ pub const Intrinsic = enum {
3192 .{ .kind = .{ .matches = 0 } },3438 .{ .kind = .{ .matches = 0 } },
3193 .{ .kind = .{ .matches = 0 } },3439 .{ .kind = .{ .matches = 0 } },
3194 },3440 },
3195 .attrs = &.{ .nocallback, .nofree, .nosync, .nounwind, .speculatable, .willreturn, .{ .memory = Attribute.Memory.all(.none) } },3441 .attrs = &.{ .nocallback, .nocreateundeforpoison, .nofree, .nosync, .nounwind, .speculatable, .willreturn, .{ .memory = .all(.none) } },
3196 },3442 },
3197 .maximum = .{3443 .maximum = .{
3198 .ret_len = 1,3444 .ret_len = 1,
...@@ -3201,7 +3447,25 @@ pub const Intrinsic = enum {...@@ -3201,7 +3447,25 @@ pub const Intrinsic = enum {
3201 .{ .kind = .{ .matches = 0 } },3447 .{ .kind = .{ .matches = 0 } },
3202 .{ .kind = .{ .matches = 0 } },3448 .{ .kind = .{ .matches = 0 } },
3203 },3449 },
3204 .attrs = &.{ .nocallback, .nofree, .nosync, .nounwind, .speculatable, .willreturn, .{ .memory = Attribute.Memory.all(.none) } },3450 .attrs = &.{ .nocallback, .nocreateundeforpoison, .nofree, .nosync, .nounwind, .speculatable, .willreturn, .{ .memory = .all(.none) } },
3451 },
3452 .minimumnum = .{
3453 .ret_len = 1,
3454 .params = &.{
3455 .{ .kind = .overloaded },
3456 .{ .kind = .{ .matches = 0 } },
3457 .{ .kind = .{ .matches = 0 } },
3458 },
3459 .attrs = &.{ .nocallback, .nocreateundeforpoison, .nofree, .nosync, .nounwind, .speculatable, .willreturn, .{ .memory = .all(.none) } },
3460 },
3461 .maximumnum = .{
3462 .ret_len = 1,
3463 .params = &.{
3464 .{ .kind = .overloaded },
3465 .{ .kind = .{ .matches = 0 } },
3466 .{ .kind = .{ .matches = 0 } },
3467 },
3468 .attrs = &.{ .nocallback, .nocreateundeforpoison, .nofree, .nosync, .nounwind, .speculatable, .willreturn, .{ .memory = .all(.none) } },
3205 },3469 },
3206 .copysign = .{3470 .copysign = .{
3207 .ret_len = 1,3471 .ret_len = 1,
...@@ -3210,7 +3474,7 @@ pub const Intrinsic = enum {...@@ -3210,7 +3474,7 @@ pub const Intrinsic = enum {
3210 .{ .kind = .{ .matches = 0 } },3474 .{ .kind = .{ .matches = 0 } },
3211 .{ .kind = .{ .matches = 0 } },3475 .{ .kind = .{ .matches = 0 } },
3212 },3476 },
3213 .attrs = &.{ .nocallback, .nofree, .nosync, .nounwind, .speculatable, .willreturn, .{ .memory = Attribute.Memory.all(.none) } },3477 .attrs = &.{ .nocallback, .nocreateundeforpoison, .nofree, .nosync, .nounwind, .speculatable, .willreturn, .{ .memory = .all(.none) } },
3214 },3478 },
3215 .floor = .{3479 .floor = .{
3216 .ret_len = 1,3480 .ret_len = 1,
...@@ -3218,7 +3482,7 @@ pub const Intrinsic = enum {...@@ -3218,7 +3482,7 @@ pub const Intrinsic = enum {
3218 .{ .kind = .overloaded },3482 .{ .kind = .overloaded },
3219 .{ .kind = .{ .matches = 0 } },3483 .{ .kind = .{ .matches = 0 } },
3220 },3484 },
3221 .attrs = &.{ .nocallback, .nofree, .nosync, .nounwind, .speculatable, .willreturn, .{ .memory = Attribute.Memory.all(.none) } },3485 .attrs = &.{ .nocallback, .nocreateundeforpoison, .nofree, .nosync, .nounwind, .speculatable, .willreturn, .{ .memory = .all(.none) } },
3222 },3486 },
3223 .ceil = .{3487 .ceil = .{
3224 .ret_len = 1,3488 .ret_len = 1,
...@@ -3226,7 +3490,7 @@ pub const Intrinsic = enum {...@@ -3226,7 +3490,7 @@ pub const Intrinsic = enum {
3226 .{ .kind = .overloaded },3490 .{ .kind = .overloaded },
3227 .{ .kind = .{ .matches = 0 } },3491 .{ .kind = .{ .matches = 0 } },
3228 },3492 },
3229 .attrs = &.{ .nocallback, .nofree, .nosync, .nounwind, .speculatable, .willreturn, .{ .memory = Attribute.Memory.all(.none) } },3493 .attrs = &.{ .nocallback, .nocreateundeforpoison, .nofree, .nosync, .nounwind, .speculatable, .willreturn, .{ .memory = .all(.none) } },
3230 },3494 },
3231 .trunc = .{3495 .trunc = .{
3232 .ret_len = 1,3496 .ret_len = 1,
...@@ -3234,7 +3498,7 @@ pub const Intrinsic = enum {...@@ -3234,7 +3498,7 @@ pub const Intrinsic = enum {
3234 .{ .kind = .overloaded },3498 .{ .kind = .overloaded },
3235 .{ .kind = .{ .matches = 0 } },3499 .{ .kind = .{ .matches = 0 } },
3236 },3500 },
3237 .attrs = &.{ .nocallback, .nofree, .nosync, .nounwind, .speculatable, .willreturn, .{ .memory = Attribute.Memory.all(.none) } },3501 .attrs = &.{ .nocallback, .nocreateundeforpoison, .nofree, .nosync, .nounwind, .speculatable, .willreturn, .{ .memory = .all(.none) } },
3238 },3502 },
3239 .rint = .{3503 .rint = .{
3240 .ret_len = 1,3504 .ret_len = 1,
...@@ -3242,7 +3506,7 @@ pub const Intrinsic = enum {...@@ -3242,7 +3506,7 @@ pub const Intrinsic = enum {
3242 .{ .kind = .overloaded },3506 .{ .kind = .overloaded },
3243 .{ .kind = .{ .matches = 0 } },3507 .{ .kind = .{ .matches = 0 } },
3244 },3508 },
3245 .attrs = &.{ .nocallback, .nofree, .nosync, .nounwind, .speculatable, .willreturn, .{ .memory = Attribute.Memory.all(.none) } },3509 .attrs = &.{ .nocallback, .nocreateundeforpoison, .nofree, .nosync, .nounwind, .speculatable, .willreturn, .{ .memory = .all(.none) } },
3246 },3510 },
3247 .nearbyint = .{3511 .nearbyint = .{
3248 .ret_len = 1,3512 .ret_len = 1,
...@@ -3250,7 +3514,7 @@ pub const Intrinsic = enum {...@@ -3250,7 +3514,7 @@ pub const Intrinsic = enum {
3250 .{ .kind = .overloaded },3514 .{ .kind = .overloaded },
3251 .{ .kind = .{ .matches = 0 } },3515 .{ .kind = .{ .matches = 0 } },
3252 },3516 },
3253 .attrs = &.{ .nocallback, .nofree, .nosync, .nounwind, .speculatable, .willreturn, .{ .memory = Attribute.Memory.all(.none) } },3517 .attrs = &.{ .nocallback, .nocreateundeforpoison, .nofree, .nosync, .nounwind, .speculatable, .willreturn, .{ .memory = .all(.none) } },
3254 },3518 },
3255 .round = .{3519 .round = .{
3256 .ret_len = 1,3520 .ret_len = 1,
...@@ -3258,7 +3522,7 @@ pub const Intrinsic = enum {...@@ -3258,7 +3522,7 @@ pub const Intrinsic = enum {
3258 .{ .kind = .overloaded },3522 .{ .kind = .overloaded },
3259 .{ .kind = .{ .matches = 0 } },3523 .{ .kind = .{ .matches = 0 } },
3260 },3524 },
3261 .attrs = &.{ .nocallback, .nofree, .nosync, .nounwind, .speculatable, .willreturn, .{ .memory = Attribute.Memory.all(.none) } },3525 .attrs = &.{ .nocallback, .nocreateundeforpoison, .nofree, .nosync, .nounwind, .speculatable, .willreturn, .{ .memory = .all(.none) } },
3262 },3526 },
3263 .roundeven = .{3527 .roundeven = .{
3264 .ret_len = 1,3528 .ret_len = 1,
...@@ -3266,7 +3530,7 @@ pub const Intrinsic = enum {...@@ -3266,7 +3530,7 @@ pub const Intrinsic = enum {
3266 .{ .kind = .overloaded },3530 .{ .kind = .overloaded },
3267 .{ .kind = .{ .matches = 0 } },3531 .{ .kind = .{ .matches = 0 } },
3268 },3532 },
3269 .attrs = &.{ .nocallback, .nofree, .nosync, .nounwind, .speculatable, .willreturn, .{ .memory = Attribute.Memory.all(.none) } },3533 .attrs = &.{ .nocallback, .nocreateundeforpoison, .nofree, .nosync, .nounwind, .speculatable, .willreturn, .{ .memory = .all(.none) } },
3270 },3534 },
3271 .lround = .{3535 .lround = .{
3272 .ret_len = 1,3536 .ret_len = 1,
...@@ -3274,7 +3538,7 @@ pub const Intrinsic = enum {...@@ -3274,7 +3538,7 @@ pub const Intrinsic = enum {
3274 .{ .kind = .overloaded },3538 .{ .kind = .overloaded },
3275 .{ .kind = .overloaded },3539 .{ .kind = .overloaded },
3276 },3540 },
3277 .attrs = &.{ .nocallback, .nofree, .nosync, .nounwind, .speculatable, .willreturn, .{ .memory = Attribute.Memory.all(.none) } },3541 .attrs = &.{ .nocallback, .nocreateundeforpoison, .nofree, .nosync, .nounwind, .speculatable, .willreturn, .{ .memory = .all(.none) } },
3278 },3542 },
3279 .llround = .{3543 .llround = .{
3280 .ret_len = 1,3544 .ret_len = 1,
...@@ -3282,7 +3546,7 @@ pub const Intrinsic = enum {...@@ -3282,7 +3546,7 @@ pub const Intrinsic = enum {
3282 .{ .kind = .overloaded },3546 .{ .kind = .overloaded },
3283 .{ .kind = .overloaded },3547 .{ .kind = .overloaded },
3284 },3548 },
3285 .attrs = &.{ .nocallback, .nofree, .nosync, .nounwind, .speculatable, .willreturn, .{ .memory = Attribute.Memory.all(.none) } },3549 .attrs = &.{ .nocallback, .nocreateundeforpoison, .nofree, .nosync, .nounwind, .speculatable, .willreturn, .{ .memory = .all(.none) } },
3286 },3550 },
3287 .lrint = .{3551 .lrint = .{
3288 .ret_len = 1,3552 .ret_len = 1,
...@@ -3290,7 +3554,7 @@ pub const Intrinsic = enum {...@@ -3290,7 +3554,7 @@ pub const Intrinsic = enum {
3290 .{ .kind = .overloaded },3554 .{ .kind = .overloaded },
3291 .{ .kind = .overloaded },3555 .{ .kind = .overloaded },
3292 },3556 },
3293 .attrs = &.{ .nocallback, .nofree, .nosync, .nounwind, .speculatable, .willreturn, .{ .memory = Attribute.Memory.all(.none) } },3557 .attrs = &.{ .nocallback, .nocreateundeforpoison, .nofree, .nosync, .nounwind, .speculatable, .willreturn, .{ .memory = .all(.none) } },
3294 },3558 },
3295 .llrint = .{3559 .llrint = .{
3296 .ret_len = 1,3560 .ret_len = 1,
...@@ -3298,7 +3562,7 @@ pub const Intrinsic = enum {...@@ -3298,7 +3562,7 @@ pub const Intrinsic = enum {
3298 .{ .kind = .overloaded },3562 .{ .kind = .overloaded },
3299 .{ .kind = .overloaded },3563 .{ .kind = .overloaded },
3300 },3564 },
3301 .attrs = &.{ .nocallback, .nofree, .nosync, .nounwind, .speculatable, .willreturn, .{ .memory = Attribute.Memory.all(.none) } },3565 .attrs = &.{ .nocallback, .nocreateundeforpoison, .nofree, .nosync, .nounwind, .speculatable, .willreturn, .{ .memory = .all(.none) } },
3302 },3566 },
33033567
3304 .bitreverse = .{3568 .bitreverse = .{
...@@ -3307,7 +3571,7 @@ pub const Intrinsic = enum {...@@ -3307,7 +3571,7 @@ pub const Intrinsic = enum {
3307 .{ .kind = .overloaded },3571 .{ .kind = .overloaded },
3308 .{ .kind = .{ .matches = 0 } },3572 .{ .kind = .{ .matches = 0 } },
3309 },3573 },
3310 .attrs = &.{ .nocallback, .nofree, .nosync, .nounwind, .speculatable, .willreturn, .{ .memory = Attribute.Memory.all(.none) } },3574 .attrs = &.{ .nocallback, .nocreateundeforpoison, .nofree, .nosync, .nounwind, .speculatable, .willreturn, .{ .memory = .all(.none) } },
3311 },3575 },
3312 .bswap = .{3576 .bswap = .{
3313 .ret_len = 1,3577 .ret_len = 1,
...@@ -3315,7 +3579,7 @@ pub const Intrinsic = enum {...@@ -3315,7 +3579,7 @@ pub const Intrinsic = enum {
3315 .{ .kind = .overloaded },3579 .{ .kind = .overloaded },
3316 .{ .kind = .{ .matches = 0 } },3580 .{ .kind = .{ .matches = 0 } },
3317 },3581 },
3318 .attrs = &.{ .nocallback, .nofree, .nosync, .nounwind, .speculatable, .willreturn, .{ .memory = Attribute.Memory.all(.none) } },3582 .attrs = &.{ .nocallback, .nocreateundeforpoison, .nofree, .nosync, .nounwind, .speculatable, .willreturn, .{ .memory = .all(.none) } },
3319 },3583 },
3320 .ctpop = .{3584 .ctpop = .{
3321 .ret_len = 1,3585 .ret_len = 1,
...@@ -3323,7 +3587,7 @@ pub const Intrinsic = enum {...@@ -3323,7 +3587,7 @@ pub const Intrinsic = enum {
3323 .{ .kind = .overloaded },3587 .{ .kind = .overloaded },
3324 .{ .kind = .{ .matches = 0 } },3588 .{ .kind = .{ .matches = 0 } },
3325 },3589 },
3326 .attrs = &.{ .nocallback, .nofree, .nosync, .nounwind, .speculatable, .willreturn, .{ .memory = Attribute.Memory.all(.none) } },3590 .attrs = &.{ .nocallback, .nocreateundeforpoison, .nofree, .nosync, .nounwind, .speculatable, .willreturn, .{ .memory = .all(.none) } },
3327 },3591 },
3328 .ctlz = .{3592 .ctlz = .{
3329 .ret_len = 1,3593 .ret_len = 1,
...@@ -3332,7 +3596,7 @@ pub const Intrinsic = enum {...@@ -3332,7 +3596,7 @@ pub const Intrinsic = enum {
3332 .{ .kind = .{ .matches = 0 } },3596 .{ .kind = .{ .matches = 0 } },
3333 .{ .kind = .{ .type = .i1 }, .attrs = &.{.immarg} },3597 .{ .kind = .{ .type = .i1 }, .attrs = &.{.immarg} },
3334 },3598 },
3335 .attrs = &.{ .nocallback, .nofree, .nosync, .nounwind, .speculatable, .willreturn, .{ .memory = Attribute.Memory.all(.none) } },3599 .attrs = &.{ .nocallback, .nofree, .nosync, .nounwind, .speculatable, .willreturn, .{ .memory = .all(.none) } },
3336 },3600 },
3337 .cttz = .{3601 .cttz = .{
3338 .ret_len = 1,3602 .ret_len = 1,
...@@ -3341,7 +3605,7 @@ pub const Intrinsic = enum {...@@ -3341,7 +3605,7 @@ pub const Intrinsic = enum {
3341 .{ .kind = .{ .matches = 0 } },3605 .{ .kind = .{ .matches = 0 } },
3342 .{ .kind = .{ .type = .i1 }, .attrs = &.{.immarg} },3606 .{ .kind = .{ .type = .i1 }, .attrs = &.{.immarg} },
3343 },3607 },
3344 .attrs = &.{ .nocallback, .nofree, .nosync, .nounwind, .speculatable, .willreturn, .{ .memory = Attribute.Memory.all(.none) } },3608 .attrs = &.{ .nocallback, .nofree, .nosync, .nounwind, .speculatable, .willreturn, .{ .memory = .all(.none) } },
3345 },3609 },
3346 .fshl = .{3610 .fshl = .{
3347 .ret_len = 1,3611 .ret_len = 1,
...@@ -3351,7 +3615,7 @@ pub const Intrinsic = enum {...@@ -3351,7 +3615,7 @@ pub const Intrinsic = enum {
3351 .{ .kind = .{ .matches = 0 } },3615 .{ .kind = .{ .matches = 0 } },
3352 .{ .kind = .{ .matches = 0 } },3616 .{ .kind = .{ .matches = 0 } },
3353 },3617 },
3354 .attrs = &.{ .nocallback, .nofree, .nosync, .nounwind, .speculatable, .willreturn, .{ .memory = Attribute.Memory.all(.none) } },3618 .attrs = &.{ .nocallback, .nocreateundeforpoison, .nofree, .nosync, .nounwind, .speculatable, .willreturn, .{ .memory = .all(.none) } },
3355 },3619 },
3356 .fshr = .{3620 .fshr = .{
3357 .ret_len = 1,3621 .ret_len = 1,
...@@ -3361,7 +3625,16 @@ pub const Intrinsic = enum {...@@ -3361,7 +3625,16 @@ pub const Intrinsic = enum {
3361 .{ .kind = .{ .matches = 0 } },3625 .{ .kind = .{ .matches = 0 } },
3362 .{ .kind = .{ .matches = 0 } },3626 .{ .kind = .{ .matches = 0 } },
3363 },3627 },
3364 .attrs = &.{ .nocallback, .nofree, .nosync, .nounwind, .speculatable, .willreturn, .{ .memory = Attribute.Memory.all(.none) } },3628 .attrs = &.{ .nocallback, .nocreateundeforpoison, .nofree, .nosync, .nounwind, .speculatable, .willreturn, .{ .memory = .all(.none) } },
3629 },
3630 .clmul = .{
3631 .ret_len = 1,
3632 .params = &.{
3633 .{ .kind = .overloaded },
3634 .{ .kind = .{ .matches = 0 } },
3635 .{ .kind = .{ .matches = 0 } },
3636 },
3637 .attrs = &.{ .nocallback, .nocreateundeforpoison, .nofree, .nosync, .nounwind, .speculatable, .willreturn, .{ .memory = .all(.none) } },
3365 },3638 },
33663639
3367 .@"sadd.with.overflow" = .{3640 .@"sadd.with.overflow" = .{
...@@ -3372,7 +3645,7 @@ pub const Intrinsic = enum {...@@ -3372,7 +3645,7 @@ pub const Intrinsic = enum {
3372 .{ .kind = .{ .matches = 0 } },3645 .{ .kind = .{ .matches = 0 } },
3373 .{ .kind = .{ .matches = 0 } },3646 .{ .kind = .{ .matches = 0 } },
3374 },3647 },
3375 .attrs = &.{ .nocallback, .nofree, .nosync, .nounwind, .speculatable, .willreturn, .{ .memory = Attribute.Memory.all(.none) } },3648 .attrs = &.{ .nocallback, .nocreateundeforpoison, .nofree, .nosync, .nounwind, .speculatable, .willreturn, .{ .memory = .all(.none) } },
3376 },3649 },
3377 .@"uadd.with.overflow" = .{3650 .@"uadd.with.overflow" = .{
3378 .ret_len = 2,3651 .ret_len = 2,
...@@ -3382,7 +3655,7 @@ pub const Intrinsic = enum {...@@ -3382,7 +3655,7 @@ pub const Intrinsic = enum {
3382 .{ .kind = .{ .matches = 0 } },3655 .{ .kind = .{ .matches = 0 } },
3383 .{ .kind = .{ .matches = 0 } },3656 .{ .kind = .{ .matches = 0 } },
3384 },3657 },
3385 .attrs = &.{ .nocallback, .nofree, .nosync, .nounwind, .speculatable, .willreturn, .{ .memory = Attribute.Memory.all(.none) } },3658 .attrs = &.{ .nocallback, .nocreateundeforpoison, .nofree, .nosync, .nounwind, .speculatable, .willreturn, .{ .memory = .all(.none) } },
3386 },3659 },
3387 .@"ssub.with.overflow" = .{3660 .@"ssub.with.overflow" = .{
3388 .ret_len = 2,3661 .ret_len = 2,
...@@ -3392,7 +3665,7 @@ pub const Intrinsic = enum {...@@ -3392,7 +3665,7 @@ pub const Intrinsic = enum {
3392 .{ .kind = .{ .matches = 0 } },3665 .{ .kind = .{ .matches = 0 } },
3393 .{ .kind = .{ .matches = 0 } },3666 .{ .kind = .{ .matches = 0 } },
3394 },3667 },
3395 .attrs = &.{ .nocallback, .nofree, .nosync, .nounwind, .speculatable, .willreturn, .{ .memory = Attribute.Memory.all(.none) } },3668 .attrs = &.{ .nocallback, .nocreateundeforpoison, .nofree, .nosync, .nounwind, .speculatable, .willreturn, .{ .memory = .all(.none) } },
3396 },3669 },
3397 .@"usub.with.overflow" = .{3670 .@"usub.with.overflow" = .{
3398 .ret_len = 2,3671 .ret_len = 2,
...@@ -3402,7 +3675,7 @@ pub const Intrinsic = enum {...@@ -3402,7 +3675,7 @@ pub const Intrinsic = enum {
3402 .{ .kind = .{ .matches = 0 } },3675 .{ .kind = .{ .matches = 0 } },
3403 .{ .kind = .{ .matches = 0 } },3676 .{ .kind = .{ .matches = 0 } },
3404 },3677 },
3405 .attrs = &.{ .nocallback, .nofree, .nosync, .nounwind, .speculatable, .willreturn, .{ .memory = Attribute.Memory.all(.none) } },3678 .attrs = &.{ .nocallback, .nocreateundeforpoison, .nofree, .nosync, .nounwind, .speculatable, .willreturn, .{ .memory = .all(.none) } },
3406 },3679 },
3407 .@"smul.with.overflow" = .{3680 .@"smul.with.overflow" = .{
3408 .ret_len = 2,3681 .ret_len = 2,
...@@ -3412,7 +3685,7 @@ pub const Intrinsic = enum {...@@ -3412,7 +3685,7 @@ pub const Intrinsic = enum {
3412 .{ .kind = .{ .matches = 0 } },3685 .{ .kind = .{ .matches = 0 } },
3413 .{ .kind = .{ .matches = 0 } },3686 .{ .kind = .{ .matches = 0 } },
3414 },3687 },
3415 .attrs = &.{ .nocallback, .nofree, .nosync, .nounwind, .speculatable, .willreturn, .{ .memory = Attribute.Memory.all(.none) } },3688 .attrs = &.{ .nocallback, .nocreateundeforpoison, .nofree, .nosync, .nounwind, .speculatable, .willreturn, .{ .memory = .all(.none) } },
3416 },3689 },
3417 .@"umul.with.overflow" = .{3690 .@"umul.with.overflow" = .{
3418 .ret_len = 2,3691 .ret_len = 2,
...@@ -3422,7 +3695,7 @@ pub const Intrinsic = enum {...@@ -3422,7 +3695,7 @@ pub const Intrinsic = enum {
3422 .{ .kind = .{ .matches = 0 } },3695 .{ .kind = .{ .matches = 0 } },
3423 .{ .kind = .{ .matches = 0 } },3696 .{ .kind = .{ .matches = 0 } },
3424 },3697 },
3425 .attrs = &.{ .nocallback, .nofree, .nosync, .nounwind, .speculatable, .willreturn, .{ .memory = Attribute.Memory.all(.none) } },3698 .attrs = &.{ .nocallback, .nocreateundeforpoison, .nofree, .nosync, .nounwind, .speculatable, .willreturn, .{ .memory = .all(.none) } },
3426 },3699 },
34273700
3428 .@"sadd.sat" = .{3701 .@"sadd.sat" = .{
...@@ -3432,7 +3705,7 @@ pub const Intrinsic = enum {...@@ -3432,7 +3705,7 @@ pub const Intrinsic = enum {
3432 .{ .kind = .{ .matches = 0 } },3705 .{ .kind = .{ .matches = 0 } },
3433 .{ .kind = .{ .matches = 0 } },3706 .{ .kind = .{ .matches = 0 } },
3434 },3707 },
3435 .attrs = &.{ .nocallback, .nofree, .nosync, .nounwind, .speculatable, .willreturn, .{ .memory = Attribute.Memory.all(.none) } },3708 .attrs = &.{ .nocallback, .nocreateundeforpoison, .nofree, .nosync, .nounwind, .speculatable, .willreturn, .{ .memory = .all(.none) } },
3436 },3709 },
3437 .@"uadd.sat" = .{3710 .@"uadd.sat" = .{
3438 .ret_len = 1,3711 .ret_len = 1,
...@@ -3441,7 +3714,7 @@ pub const Intrinsic = enum {...@@ -3441,7 +3714,7 @@ pub const Intrinsic = enum {
3441 .{ .kind = .{ .matches = 0 } },3714 .{ .kind = .{ .matches = 0 } },
3442 .{ .kind = .{ .matches = 0 } },3715 .{ .kind = .{ .matches = 0 } },
3443 },3716 },
3444 .attrs = &.{ .nocallback, .nofree, .nosync, .nounwind, .speculatable, .willreturn, .{ .memory = Attribute.Memory.all(.none) } },3717 .attrs = &.{ .nocallback, .nocreateundeforpoison, .nofree, .nosync, .nounwind, .speculatable, .willreturn, .{ .memory = .all(.none) } },
3445 },3718 },
3446 .@"ssub.sat" = .{3719 .@"ssub.sat" = .{
3447 .ret_len = 1,3720 .ret_len = 1,
...@@ -3450,7 +3723,7 @@ pub const Intrinsic = enum {...@@ -3450,7 +3723,7 @@ pub const Intrinsic = enum {
3450 .{ .kind = .{ .matches = 0 } },3723 .{ .kind = .{ .matches = 0 } },
3451 .{ .kind = .{ .matches = 0 } },3724 .{ .kind = .{ .matches = 0 } },
3452 },3725 },
3453 .attrs = &.{ .nocallback, .nofree, .nosync, .nounwind, .speculatable, .willreturn, .{ .memory = Attribute.Memory.all(.none) } },3726 .attrs = &.{ .nocallback, .nocreateundeforpoison, .nofree, .nosync, .nounwind, .speculatable, .willreturn, .{ .memory = .all(.none) } },
3454 },3727 },
3455 .@"usub.sat" = .{3728 .@"usub.sat" = .{
3456 .ret_len = 1,3729 .ret_len = 1,
...@@ -3459,7 +3732,7 @@ pub const Intrinsic = enum {...@@ -3459,7 +3732,7 @@ pub const Intrinsic = enum {
3459 .{ .kind = .{ .matches = 0 } },3732 .{ .kind = .{ .matches = 0 } },
3460 .{ .kind = .{ .matches = 0 } },3733 .{ .kind = .{ .matches = 0 } },
3461 },3734 },
3462 .attrs = &.{ .nocallback, .nofree, .nosync, .nounwind, .speculatable, .willreturn, .{ .memory = Attribute.Memory.all(.none) } },3735 .attrs = &.{ .nocallback, .nocreateundeforpoison, .nofree, .nosync, .nounwind, .speculatable, .willreturn, .{ .memory = .all(.none) } },
3463 },3736 },
3464 .@"sshl.sat" = .{3737 .@"sshl.sat" = .{
3465 .ret_len = 1,3738 .ret_len = 1,
...@@ -3468,7 +3741,7 @@ pub const Intrinsic = enum {...@@ -3468,7 +3741,7 @@ pub const Intrinsic = enum {
3468 .{ .kind = .{ .matches = 0 } },3741 .{ .kind = .{ .matches = 0 } },
3469 .{ .kind = .{ .matches = 0 } },3742 .{ .kind = .{ .matches = 0 } },
3470 },3743 },
3471 .attrs = &.{ .nocallback, .nofree, .nosync, .nounwind, .speculatable, .willreturn, .{ .memory = Attribute.Memory.all(.none) } },3744 .attrs = &.{ .nocallback, .nofree, .nosync, .nounwind, .speculatable, .willreturn, .{ .memory = .all(.none) } },
3472 },3745 },
3473 .@"ushl.sat" = .{3746 .@"ushl.sat" = .{
3474 .ret_len = 1,3747 .ret_len = 1,
...@@ -3477,7 +3750,7 @@ pub const Intrinsic = enum {...@@ -3477,7 +3750,7 @@ pub const Intrinsic = enum {
3477 .{ .kind = .{ .matches = 0 } },3750 .{ .kind = .{ .matches = 0 } },
3478 .{ .kind = .{ .matches = 0 } },3751 .{ .kind = .{ .matches = 0 } },
3479 },3752 },
3480 .attrs = &.{ .nocallback, .nofree, .nosync, .nounwind, .speculatable, .willreturn, .{ .memory = Attribute.Memory.all(.none) } },3753 .attrs = &.{ .nocallback, .nofree, .nosync, .nounwind, .speculatable, .willreturn, .{ .memory = .all(.none) } },
3481 },3754 },
34823755
3483 .@"smul.fix" = .{3756 .@"smul.fix" = .{
...@@ -3488,7 +3761,7 @@ pub const Intrinsic = enum {...@@ -3488,7 +3761,7 @@ pub const Intrinsic = enum {
3488 .{ .kind = .{ .matches = 0 } },3761 .{ .kind = .{ .matches = 0 } },
3489 .{ .kind = .{ .type = .i32 }, .attrs = &.{.immarg} },3762 .{ .kind = .{ .type = .i32 }, .attrs = &.{.immarg} },
3490 },3763 },
3491 .attrs = &.{ .nocallback, .nofree, .nosync, .nounwind, .speculatable, .willreturn, .{ .memory = Attribute.Memory.all(.none) } },3764 .attrs = &.{ .nocallback, .nofree, .nosync, .nounwind, .speculatable, .willreturn, .{ .memory = .all(.none) } },
3492 },3765 },
3493 .@"umul.fix" = .{3766 .@"umul.fix" = .{
3494 .ret_len = 1,3767 .ret_len = 1,
...@@ -3498,7 +3771,7 @@ pub const Intrinsic = enum {...@@ -3498,7 +3771,7 @@ pub const Intrinsic = enum {
3498 .{ .kind = .{ .matches = 0 } },3771 .{ .kind = .{ .matches = 0 } },
3499 .{ .kind = .{ .type = .i32 }, .attrs = &.{.immarg} },3772 .{ .kind = .{ .type = .i32 }, .attrs = &.{.immarg} },
3500 },3773 },
3501 .attrs = &.{ .nocallback, .nofree, .nosync, .nounwind, .speculatable, .willreturn, .{ .memory = Attribute.Memory.all(.none) } },3774 .attrs = &.{ .nocallback, .nofree, .nosync, .nounwind, .speculatable, .willreturn, .{ .memory = .all(.none) } },
3502 },3775 },
3503 .@"smul.fix.sat" = .{3776 .@"smul.fix.sat" = .{
3504 .ret_len = 1,3777 .ret_len = 1,
...@@ -3508,7 +3781,7 @@ pub const Intrinsic = enum {...@@ -3508,7 +3781,7 @@ pub const Intrinsic = enum {
3508 .{ .kind = .{ .matches = 0 } },3781 .{ .kind = .{ .matches = 0 } },
3509 .{ .kind = .{ .type = .i32 }, .attrs = &.{.immarg} },3782 .{ .kind = .{ .type = .i32 }, .attrs = &.{.immarg} },
3510 },3783 },
3511 .attrs = &.{ .nocallback, .nofree, .nosync, .nounwind, .speculatable, .willreturn, .{ .memory = Attribute.Memory.all(.none) } },3784 .attrs = &.{ .nocallback, .nofree, .nosync, .nounwind, .speculatable, .willreturn, .{ .memory = .all(.none) } },
3512 },3785 },
3513 .@"umul.fix.sat" = .{3786 .@"umul.fix.sat" = .{
3514 .ret_len = 1,3787 .ret_len = 1,
...@@ -3518,7 +3791,7 @@ pub const Intrinsic = enum {...@@ -3518,7 +3791,7 @@ pub const Intrinsic = enum {
3518 .{ .kind = .{ .matches = 0 } },3791 .{ .kind = .{ .matches = 0 } },
3519 .{ .kind = .{ .type = .i32 }, .attrs = &.{.immarg} },3792 .{ .kind = .{ .type = .i32 }, .attrs = &.{.immarg} },
3520 },3793 },
3521 .attrs = &.{ .nocallback, .nofree, .nosync, .nounwind, .speculatable, .willreturn, .{ .memory = Attribute.Memory.all(.none) } },3794 .attrs = &.{ .nocallback, .nofree, .nosync, .nounwind, .speculatable, .willreturn, .{ .memory = .all(.none) } },
3522 },3795 },
3523 .@"sdiv.fix" = .{3796 .@"sdiv.fix" = .{
3524 .ret_len = 1,3797 .ret_len = 1,
...@@ -3528,7 +3801,7 @@ pub const Intrinsic = enum {...@@ -3528,7 +3801,7 @@ pub const Intrinsic = enum {
3528 .{ .kind = .{ .matches = 0 } },3801 .{ .kind = .{ .matches = 0 } },
3529 .{ .kind = .{ .type = .i32 }, .attrs = &.{.immarg} },3802 .{ .kind = .{ .type = .i32 }, .attrs = &.{.immarg} },
3530 },3803 },
3531 .attrs = &.{ .nocallback, .nofree, .nosync, .nounwind, .willreturn, .{ .memory = Attribute.Memory.all(.none) } },3804 .attrs = &.{ .nocallback, .nofree, .nosync, .nounwind, .willreturn, .{ .memory = .all(.none) } },
3532 },3805 },
3533 .@"udiv.fix" = .{3806 .@"udiv.fix" = .{
3534 .ret_len = 1,3807 .ret_len = 1,
...@@ -3538,7 +3811,7 @@ pub const Intrinsic = enum {...@@ -3538,7 +3811,7 @@ pub const Intrinsic = enum {
3538 .{ .kind = .{ .matches = 0 } },3811 .{ .kind = .{ .matches = 0 } },
3539 .{ .kind = .{ .type = .i32 }, .attrs = &.{.immarg} },3812 .{ .kind = .{ .type = .i32 }, .attrs = &.{.immarg} },
3540 },3813 },
3541 .attrs = &.{ .nocallback, .nofree, .nosync, .nounwind, .willreturn, .{ .memory = Attribute.Memory.all(.none) } },3814 .attrs = &.{ .nocallback, .nofree, .nosync, .nounwind, .willreturn, .{ .memory = .all(.none) } },
3542 },3815 },
3543 .@"sdiv.fix.sat" = .{3816 .@"sdiv.fix.sat" = .{
3544 .ret_len = 1,3817 .ret_len = 1,
...@@ -3548,7 +3821,7 @@ pub const Intrinsic = enum {...@@ -3548,7 +3821,7 @@ pub const Intrinsic = enum {
3548 .{ .kind = .{ .matches = 0 } },3821 .{ .kind = .{ .matches = 0 } },
3549 .{ .kind = .{ .type = .i32 }, .attrs = &.{.immarg} },3822 .{ .kind = .{ .type = .i32 }, .attrs = &.{.immarg} },
3550 },3823 },
3551 .attrs = &.{ .nocallback, .nofree, .nosync, .nounwind, .willreturn, .{ .memory = Attribute.Memory.all(.none) } },3824 .attrs = &.{ .nocallback, .nofree, .nosync, .nounwind, .willreturn, .{ .memory = .all(.none) } },
3552 },3825 },
3553 .@"udiv.fix.sat" = .{3826 .@"udiv.fix.sat" = .{
3554 .ret_len = 1,3827 .ret_len = 1,
...@@ -3558,7 +3831,7 @@ pub const Intrinsic = enum {...@@ -3558,7 +3831,7 @@ pub const Intrinsic = enum {
3558 .{ .kind = .{ .matches = 0 } },3831 .{ .kind = .{ .matches = 0 } },
3559 .{ .kind = .{ .type = .i32 }, .attrs = &.{.immarg} },3832 .{ .kind = .{ .type = .i32 }, .attrs = &.{.immarg} },
3560 },3833 },
3561 .attrs = &.{ .nocallback, .nofree, .nosync, .nounwind, .willreturn, .{ .memory = Attribute.Memory.all(.none) } },3834 .attrs = &.{ .nocallback, .nofree, .nosync, .nounwind, .willreturn, .{ .memory = .all(.none) } },
3562 },3835 },
35633836
3564 .canonicalize = .{3837 .canonicalize = .{
...@@ -3567,7 +3840,7 @@ pub const Intrinsic = enum {...@@ -3567,7 +3840,7 @@ pub const Intrinsic = enum {
3567 .{ .kind = .overloaded },3840 .{ .kind = .overloaded },
3568 .{ .kind = .{ .matches = 0 } },3841 .{ .kind = .{ .matches = 0 } },
3569 },3842 },
3570 .attrs = &.{ .nocallback, .nofree, .nosync, .nounwind, .speculatable, .willreturn, .{ .memory = Attribute.Memory.all(.none) } },3843 .attrs = &.{ .nocallback, .nocreateundeforpoison, .nofree, .nosync, .nounwind, .speculatable, .willreturn, .{ .memory = .all(.none) } },
3571 },3844 },
3572 .fmuladd = .{3845 .fmuladd = .{
3573 .ret_len = 1,3846 .ret_len = 1,
...@@ -3577,7 +3850,7 @@ pub const Intrinsic = enum {...@@ -3577,7 +3850,7 @@ pub const Intrinsic = enum {
3577 .{ .kind = .{ .matches = 0 } },3850 .{ .kind = .{ .matches = 0 } },
3578 .{ .kind = .{ .matches = 0 } },3851 .{ .kind = .{ .matches = 0 } },
3579 },3852 },
3580 .attrs = &.{ .nocallback, .nofree, .nosync, .nounwind, .speculatable, .willreturn, .{ .memory = Attribute.Memory.all(.none) } },3853 .attrs = &.{ .nocallback, .nocreateundeforpoison, .nofree, .nosync, .nounwind, .speculatable, .willreturn, .{ .memory = .all(.none) } },
3581 },3854 },
35823855
3583 .@"vector.reduce.add" = .{3856 .@"vector.reduce.add" = .{
...@@ -3586,7 +3859,7 @@ pub const Intrinsic = enum {...@@ -3586,7 +3859,7 @@ pub const Intrinsic = enum {
3586 .{ .kind = .{ .matches_scalar = 1 } },3859 .{ .kind = .{ .matches_scalar = 1 } },
3587 .{ .kind = .overloaded },3860 .{ .kind = .overloaded },
3588 },3861 },
3589 .attrs = &.{ .nocallback, .nofree, .nosync, .nounwind, .speculatable, .willreturn, .{ .memory = Attribute.Memory.all(.none) } },3862 .attrs = &.{ .nocallback, .nofree, .nosync, .nounwind, .speculatable, .willreturn, .{ .memory = .all(.none) } },
3590 },3863 },
3591 .@"vector.reduce.fadd" = .{3864 .@"vector.reduce.fadd" = .{
3592 .ret_len = 1,3865 .ret_len = 1,
...@@ -3595,7 +3868,7 @@ pub const Intrinsic = enum {...@@ -3595,7 +3868,7 @@ pub const Intrinsic = enum {
3595 .{ .kind = .{ .matches_scalar = 2 } },3868 .{ .kind = .{ .matches_scalar = 2 } },
3596 .{ .kind = .overloaded },3869 .{ .kind = .overloaded },
3597 },3870 },
3598 .attrs = &.{ .nocallback, .nofree, .nosync, .nounwind, .speculatable, .willreturn, .{ .memory = Attribute.Memory.all(.none) } },3871 .attrs = &.{ .nocallback, .nofree, .nosync, .nounwind, .speculatable, .willreturn, .{ .memory = .all(.none) } },
3599 },3872 },
3600 .@"vector.reduce.mul" = .{3873 .@"vector.reduce.mul" = .{
3601 .ret_len = 1,3874 .ret_len = 1,
...@@ -3603,7 +3876,7 @@ pub const Intrinsic = enum {...@@ -3603,7 +3876,7 @@ pub const Intrinsic = enum {
3603 .{ .kind = .{ .matches_scalar = 1 } },3876 .{ .kind = .{ .matches_scalar = 1 } },
3604 .{ .kind = .overloaded },3877 .{ .kind = .overloaded },
3605 },3878 },
3606 .attrs = &.{ .nocallback, .nofree, .nosync, .nounwind, .speculatable, .willreturn, .{ .memory = Attribute.Memory.all(.none) } },3879 .attrs = &.{ .nocallback, .nofree, .nosync, .nounwind, .speculatable, .willreturn, .{ .memory = .all(.none) } },
3607 },3880 },
3608 .@"vector.reduce.fmul" = .{3881 .@"vector.reduce.fmul" = .{
3609 .ret_len = 1,3882 .ret_len = 1,
...@@ -3612,7 +3885,7 @@ pub const Intrinsic = enum {...@@ -3612,7 +3885,7 @@ pub const Intrinsic = enum {
3612 .{ .kind = .{ .matches_scalar = 2 } },3885 .{ .kind = .{ .matches_scalar = 2 } },
3613 .{ .kind = .overloaded },3886 .{ .kind = .overloaded },
3614 },3887 },
3615 .attrs = &.{ .nocallback, .nofree, .nosync, .nounwind, .speculatable, .willreturn, .{ .memory = Attribute.Memory.all(.none) } },3888 .attrs = &.{ .nocallback, .nofree, .nosync, .nounwind, .speculatable, .willreturn, .{ .memory = .all(.none) } },
3616 },3889 },
3617 .@"vector.reduce.and" = .{3890 .@"vector.reduce.and" = .{
3618 .ret_len = 1,3891 .ret_len = 1,
...@@ -3620,7 +3893,7 @@ pub const Intrinsic = enum {...@@ -3620,7 +3893,7 @@ pub const Intrinsic = enum {
3620 .{ .kind = .{ .matches_scalar = 1 } },3893 .{ .kind = .{ .matches_scalar = 1 } },
3621 .{ .kind = .overloaded },3894 .{ .kind = .overloaded },
3622 },3895 },
3623 .attrs = &.{ .nocallback, .nofree, .nosync, .nounwind, .speculatable, .willreturn, .{ .memory = Attribute.Memory.all(.none) } },3896 .attrs = &.{ .nocallback, .nofree, .nosync, .nounwind, .speculatable, .willreturn, .{ .memory = .all(.none) } },
3624 },3897 },
3625 .@"vector.reduce.or" = .{3898 .@"vector.reduce.or" = .{
3626 .ret_len = 1,3899 .ret_len = 1,
...@@ -3628,7 +3901,7 @@ pub const Intrinsic = enum {...@@ -3628,7 +3901,7 @@ pub const Intrinsic = enum {
3628 .{ .kind = .{ .matches_scalar = 1 } },3901 .{ .kind = .{ .matches_scalar = 1 } },
3629 .{ .kind = .overloaded },3902 .{ .kind = .overloaded },
3630 },3903 },
3631 .attrs = &.{ .nocallback, .nofree, .nosync, .nounwind, .speculatable, .willreturn, .{ .memory = Attribute.Memory.all(.none) } },3904 .attrs = &.{ .nocallback, .nofree, .nosync, .nounwind, .speculatable, .willreturn, .{ .memory = .all(.none) } },
3632 },3905 },
3633 .@"vector.reduce.xor" = .{3906 .@"vector.reduce.xor" = .{
3634 .ret_len = 1,3907 .ret_len = 1,
...@@ -3636,7 +3909,7 @@ pub const Intrinsic = enum {...@@ -3636,7 +3909,7 @@ pub const Intrinsic = enum {
3636 .{ .kind = .{ .matches_scalar = 1 } },3909 .{ .kind = .{ .matches_scalar = 1 } },
3637 .{ .kind = .overloaded },3910 .{ .kind = .overloaded },
3638 },3911 },
3639 .attrs = &.{ .nocallback, .nofree, .nosync, .nounwind, .speculatable, .willreturn, .{ .memory = Attribute.Memory.all(.none) } },3912 .attrs = &.{ .nocallback, .nofree, .nosync, .nounwind, .speculatable, .willreturn, .{ .memory = .all(.none) } },
3640 },3913 },
3641 .@"vector.reduce.smax" = .{3914 .@"vector.reduce.smax" = .{
3642 .ret_len = 1,3915 .ret_len = 1,
...@@ -3644,7 +3917,7 @@ pub const Intrinsic = enum {...@@ -3644,7 +3917,7 @@ pub const Intrinsic = enum {
3644 .{ .kind = .{ .matches_scalar = 1 } },3917 .{ .kind = .{ .matches_scalar = 1 } },
3645 .{ .kind = .overloaded },3918 .{ .kind = .overloaded },
3646 },3919 },
3647 .attrs = &.{ .nocallback, .nofree, .nosync, .nounwind, .speculatable, .willreturn, .{ .memory = Attribute.Memory.all(.none) } },3920 .attrs = &.{ .nocallback, .nofree, .nosync, .nounwind, .speculatable, .willreturn, .{ .memory = .all(.none) } },
3648 },3921 },
3649 .@"vector.reduce.smin" = .{3922 .@"vector.reduce.smin" = .{
3650 .ret_len = 1,3923 .ret_len = 1,
...@@ -3652,7 +3925,7 @@ pub const Intrinsic = enum {...@@ -3652,7 +3925,7 @@ pub const Intrinsic = enum {
3652 .{ .kind = .{ .matches_scalar = 1 } },3925 .{ .kind = .{ .matches_scalar = 1 } },
3653 .{ .kind = .overloaded },3926 .{ .kind = .overloaded },
3654 },3927 },
3655 .attrs = &.{ .nocallback, .nofree, .nosync, .nounwind, .speculatable, .willreturn, .{ .memory = Attribute.Memory.all(.none) } },3928 .attrs = &.{ .nocallback, .nofree, .nosync, .nounwind, .speculatable, .willreturn, .{ .memory = .all(.none) } },
3656 },3929 },
3657 .@"vector.reduce.umax" = .{3930 .@"vector.reduce.umax" = .{
3658 .ret_len = 1,3931 .ret_len = 1,
...@@ -3660,7 +3933,7 @@ pub const Intrinsic = enum {...@@ -3660,7 +3933,7 @@ pub const Intrinsic = enum {
3660 .{ .kind = .{ .matches_scalar = 1 } },3933 .{ .kind = .{ .matches_scalar = 1 } },
3661 .{ .kind = .overloaded },3934 .{ .kind = .overloaded },
3662 },3935 },
3663 .attrs = &.{ .nocallback, .nofree, .nosync, .nounwind, .speculatable, .willreturn, .{ .memory = Attribute.Memory.all(.none) } },3936 .attrs = &.{ .nocallback, .nofree, .nosync, .nounwind, .speculatable, .willreturn, .{ .memory = .all(.none) } },
3664 },3937 },
3665 .@"vector.reduce.umin" = .{3938 .@"vector.reduce.umin" = .{
3666 .ret_len = 1,3939 .ret_len = 1,
...@@ -3668,7 +3941,7 @@ pub const Intrinsic = enum {...@@ -3668,7 +3941,7 @@ pub const Intrinsic = enum {
3668 .{ .kind = .{ .matches_scalar = 1 } },3941 .{ .kind = .{ .matches_scalar = 1 } },
3669 .{ .kind = .overloaded },3942 .{ .kind = .overloaded },
3670 },3943 },
3671 .attrs = &.{ .nocallback, .nofree, .nosync, .nounwind, .speculatable, .willreturn, .{ .memory = Attribute.Memory.all(.none) } },3944 .attrs = &.{ .nocallback, .nofree, .nosync, .nounwind, .speculatable, .willreturn, .{ .memory = .all(.none) } },
3672 },3945 },
3673 .@"vector.reduce.fmax" = .{3946 .@"vector.reduce.fmax" = .{
3674 .ret_len = 1,3947 .ret_len = 1,
...@@ -3676,7 +3949,7 @@ pub const Intrinsic = enum {...@@ -3676,7 +3949,7 @@ pub const Intrinsic = enum {
3676 .{ .kind = .{ .matches_scalar = 1 } },3949 .{ .kind = .{ .matches_scalar = 1 } },
3677 .{ .kind = .overloaded },3950 .{ .kind = .overloaded },
3678 },3951 },
3679 .attrs = &.{ .nocallback, .nofree, .nosync, .nounwind, .speculatable, .willreturn, .{ .memory = Attribute.Memory.all(.none) } },3952 .attrs = &.{ .nocallback, .nofree, .nosync, .nounwind, .speculatable, .willreturn, .{ .memory = .all(.none) } },
3680 },3953 },
3681 .@"vector.reduce.fmin" = .{3954 .@"vector.reduce.fmin" = .{
3682 .ret_len = 1,3955 .ret_len = 1,
...@@ -3684,7 +3957,7 @@ pub const Intrinsic = enum {...@@ -3684,7 +3957,7 @@ pub const Intrinsic = enum {
3684 .{ .kind = .{ .matches_scalar = 1 } },3957 .{ .kind = .{ .matches_scalar = 1 } },
3685 .{ .kind = .overloaded },3958 .{ .kind = .overloaded },
3686 },3959 },
3687 .attrs = &.{ .nocallback, .nofree, .nosync, .nounwind, .speculatable, .willreturn, .{ .memory = Attribute.Memory.all(.none) } },3960 .attrs = &.{ .nocallback, .nofree, .nosync, .nounwind, .speculatable, .willreturn, .{ .memory = .all(.none) } },
3688 },3961 },
3689 .@"vector.reduce.fmaximum" = .{3962 .@"vector.reduce.fmaximum" = .{
3690 .ret_len = 1,3963 .ret_len = 1,
...@@ -3692,7 +3965,7 @@ pub const Intrinsic = enum {...@@ -3692,7 +3965,7 @@ pub const Intrinsic = enum {
3692 .{ .kind = .{ .matches_scalar = 1 } },3965 .{ .kind = .{ .matches_scalar = 1 } },
3693 .{ .kind = .overloaded },3966 .{ .kind = .overloaded },
3694 },3967 },
3695 .attrs = &.{ .nocallback, .nofree, .nosync, .nounwind, .speculatable, .willreturn, .{ .memory = Attribute.Memory.all(.none) } },3968 .attrs = &.{ .nocallback, .nofree, .nosync, .nounwind, .speculatable, .willreturn, .{ .memory = .all(.none) } },
3696 },3969 },
3697 .@"vector.reduce.fminimum" = .{3970 .@"vector.reduce.fminimum" = .{
3698 .ret_len = 1,3971 .ret_len = 1,
...@@ -3700,7 +3973,7 @@ pub const Intrinsic = enum {...@@ -3700,7 +3973,7 @@ pub const Intrinsic = enum {
3700 .{ .kind = .{ .matches_scalar = 1 } },3973 .{ .kind = .{ .matches_scalar = 1 } },
3701 .{ .kind = .overloaded },3974 .{ .kind = .overloaded },
3702 },3975 },
3703 .attrs = &.{ .nocallback, .nofree, .nosync, .nounwind, .speculatable, .willreturn, .{ .memory = Attribute.Memory.all(.none) } },3976 .attrs = &.{ .nocallback, .nofree, .nosync, .nounwind, .speculatable, .willreturn, .{ .memory = .all(.none) } },
3704 },3977 },
3705 .@"vector.insert" = .{3978 .@"vector.insert" = .{
3706 .ret_len = 1,3979 .ret_len = 1,
...@@ -3710,7 +3983,7 @@ pub const Intrinsic = enum {...@@ -3710,7 +3983,7 @@ pub const Intrinsic = enum {
3710 .{ .kind = .overloaded },3983 .{ .kind = .overloaded },
3711 .{ .kind = .{ .type = .i64 } },3984 .{ .kind = .{ .type = .i64 } },
3712 },3985 },
3713 .attrs = &.{ .nocallback, .nofree, .nosync, .nounwind, .speculatable, .willreturn, .{ .memory = Attribute.Memory.all(.none) } },3986 .attrs = &.{ .nocallback, .nofree, .nosync, .nounwind, .speculatable, .willreturn, .{ .memory = .all(.none) } },
3714 },3987 },
3715 .@"vector.extract" = .{3988 .@"vector.extract" = .{
3716 .ret_len = 1,3989 .ret_len = 1,
...@@ -3719,7 +3992,7 @@ pub const Intrinsic = enum {...@@ -3719,7 +3992,7 @@ pub const Intrinsic = enum {
3719 .{ .kind = .overloaded },3992 .{ .kind = .overloaded },
3720 .{ .kind = .{ .type = .i64 } },3993 .{ .kind = .{ .type = .i64 } },
3721 },3994 },
3722 .attrs = &.{ .nocallback, .nofree, .nosync, .nounwind, .speculatable, .willreturn, .{ .memory = Attribute.Memory.all(.none) } },3995 .attrs = &.{ .nocallback, .nofree, .nosync, .nounwind, .speculatable, .willreturn, .{ .memory = .all(.none) } },
3723 },3996 },
37243997
3725 .@"is.fpclass" = .{3998 .@"is.fpclass" = .{
...@@ -3729,7 +4002,7 @@ pub const Intrinsic = enum {...@@ -3729,7 +4002,7 @@ pub const Intrinsic = enum {
3729 .{ .kind = .overloaded },4002 .{ .kind = .overloaded },
3730 .{ .kind = .{ .type = .i32 }, .attrs = &.{.immarg} },4003 .{ .kind = .{ .type = .i32 }, .attrs = &.{.immarg} },
3731 },4004 },
3732 .attrs = &.{ .nocallback, .nofree, .nosync, .nounwind, .speculatable, .willreturn, .{ .memory = Attribute.Memory.all(.none) } },4005 .attrs = &.{ .nocallback, .nocreateundeforpoison, .nofree, .nosync, .nounwind, .speculatable, .willreturn, .{ .memory = .all(.none) } },
3733 },4006 },
37344007
3735 .@"var.annotation" = .{4008 .@"var.annotation" = .{
...@@ -3814,7 +4087,7 @@ pub const Intrinsic = enum {...@@ -3814,7 +4087,7 @@ pub const Intrinsic = enum {
3814 .{ .kind = .{ .type = .i1 }, .attrs = &.{.immarg} },4087 .{ .kind = .{ .type = .i1 }, .attrs = &.{.immarg} },
3815 .{ .kind = .{ .type = .i1 }, .attrs = &.{.immarg} },4088 .{ .kind = .{ .type = .i1 }, .attrs = &.{.immarg} },
3816 },4089 },
3817 .attrs = &.{ .nocallback, .nofree, .nosync, .nounwind, .speculatable, .willreturn, .{ .memory = Attribute.Memory.all(.none) } },4090 .attrs = &.{ .nocallback, .nofree, .nosync, .nounwind, .speculatable, .willreturn, .{ .memory = .all(.none) } },
3818 },4091 },
3819 .expect = .{4092 .expect = .{
3820 .ret_len = 1,4093 .ret_len = 1,
...@@ -3823,7 +4096,7 @@ pub const Intrinsic = enum {...@@ -3823,7 +4096,7 @@ pub const Intrinsic = enum {
3823 .{ .kind = .{ .matches = 0 } },4096 .{ .kind = .{ .matches = 0 } },
3824 .{ .kind = .{ .matches = 0 } },4097 .{ .kind = .{ .matches = 0 } },
3825 },4098 },
3826 .attrs = &.{ .nocallback, .nofree, .nosync, .nounwind, .willreturn, .{ .memory = Attribute.Memory.all(.none) } },4099 .attrs = &.{ .nocallback, .nofree, .nosync, .nounwind, .willreturn, .{ .memory = .all(.none) } },
3827 },4100 },
3828 .@"expect.with.probability" = .{4101 .@"expect.with.probability" = .{
3829 .ret_len = 1,4102 .ret_len = 1,
...@@ -3833,7 +4106,7 @@ pub const Intrinsic = enum {...@@ -3833,7 +4106,7 @@ pub const Intrinsic = enum {
3833 .{ .kind = .{ .matches = 0 } },4106 .{ .kind = .{ .matches = 0 } },
3834 .{ .kind = .{ .type = .double }, .attrs = &.{.immarg} },4107 .{ .kind = .{ .type = .double }, .attrs = &.{.immarg} },
3835 },4108 },
3836 .attrs = &.{ .nocallback, .nofree, .nosync, .nounwind, .willreturn, .{ .memory = Attribute.Memory.all(.none) } },4109 .attrs = &.{ .nocallback, .nofree, .nosync, .nounwind, .willreturn, .{ .memory = .all(.none) } },
3837 },4110 },
3838 .assume = .{4111 .assume = .{
3839 .ret_len = 0,4112 .ret_len = 0,
...@@ -3848,7 +4121,7 @@ pub const Intrinsic = enum {...@@ -3848,7 +4121,7 @@ pub const Intrinsic = enum {
3848 .{ .kind = .overloaded },4121 .{ .kind = .overloaded },
3849 .{ .kind = .{ .matches = 0 }, .attrs = &.{.returned} },4122 .{ .kind = .{ .matches = 0 }, .attrs = &.{.returned} },
3850 },4123 },
3851 .attrs = &.{ .nocallback, .nofree, .nosync, .nounwind, .willreturn, .{ .memory = Attribute.Memory.all(.none) } },4124 .attrs = &.{ .nocallback, .nofree, .nosync, .nounwind, .willreturn, .{ .memory = .all(.none) } },
3852 },4125 },
3853 .@"type.test" = .{4126 .@"type.test" = .{
3854 .ret_len = 1,4127 .ret_len = 1,
...@@ -3857,7 +4130,7 @@ pub const Intrinsic = enum {...@@ -3857,7 +4130,7 @@ pub const Intrinsic = enum {
3857 .{ .kind = .{ .type = .ptr } },4130 .{ .kind = .{ .type = .ptr } },
3858 .{ .kind = .{ .type = .metadata } },4131 .{ .kind = .{ .type = .metadata } },
3859 },4132 },
3860 .attrs = &.{ .nocallback, .nofree, .nosync, .nounwind, .speculatable, .willreturn, .{ .memory = Attribute.Memory.all(.none) } },4133 .attrs = &.{ .nocallback, .nofree, .nosync, .nounwind, .speculatable, .willreturn, .{ .memory = .all(.none) } },
3861 },4134 },
3862 .@"type.checked.load" = .{4135 .@"type.checked.load" = .{
3863 .ret_len = 2,4136 .ret_len = 2,
...@@ -3868,7 +4141,7 @@ pub const Intrinsic = enum {...@@ -3868,7 +4141,7 @@ pub const Intrinsic = enum {
3868 .{ .kind = .{ .type = .i32 } },4141 .{ .kind = .{ .type = .i32 } },
3869 .{ .kind = .{ .type = .metadata } },4142 .{ .kind = .{ .type = .metadata } },
3870 },4143 },
3871 .attrs = &.{ .nocallback, .nofree, .nosync, .nounwind, .willreturn, .{ .memory = Attribute.Memory.all(.none) } },4144 .attrs = &.{ .nocallback, .nofree, .nosync, .nounwind, .willreturn, .{ .memory = .all(.none) } },
3872 },4145 },
3873 .@"type.checked.load.relative" = .{4146 .@"type.checked.load.relative" = .{
3874 .ret_len = 2,4147 .ret_len = 2,
...@@ -3879,7 +4152,7 @@ pub const Intrinsic = enum {...@@ -3879,7 +4152,7 @@ pub const Intrinsic = enum {
3879 .{ .kind = .{ .type = .i32 } },4152 .{ .kind = .{ .type = .i32 } },
3880 .{ .kind = .{ .type = .metadata } },4153 .{ .kind = .{ .type = .metadata } },
3881 },4154 },
3882 .attrs = &.{ .nocallback, .nofree, .nosync, .nounwind, .willreturn, .{ .memory = Attribute.Memory.all(.none) } },4155 .attrs = &.{ .nocallback, .nofree, .nosync, .nounwind, .willreturn, .{ .memory = .all(.none) } },
3883 },4156 },
3884 .@"arithmetic.fence" = .{4157 .@"arithmetic.fence" = .{
3885 .ret_len = 1,4158 .ret_len = 1,
...@@ -3887,12 +4160,12 @@ pub const Intrinsic = enum {...@@ -3887,12 +4160,12 @@ pub const Intrinsic = enum {
3887 .{ .kind = .overloaded },4160 .{ .kind = .overloaded },
3888 .{ .kind = .{ .matches = 0 } },4161 .{ .kind = .{ .matches = 0 } },
3889 },4162 },
3890 .attrs = &.{ .nocallback, .nofree, .nosync, .nounwind, .speculatable, .willreturn, .{ .memory = Attribute.Memory.all(.none) } },4163 .attrs = &.{ .nocallback, .nofree, .nosync, .nounwind, .speculatable, .willreturn, .{ .memory = .all(.none) } },
3891 },4164 },
3892 .donothing = .{4165 .donothing = .{
3893 .ret_len = 0,4166 .ret_len = 0,
3894 .params = &.{},4167 .params = &.{},
3895 .attrs = &.{ .nocallback, .nofree, .nosync, .nounwind, .willreturn, .{ .memory = Attribute.Memory.all(.none) } },4168 .attrs = &.{ .nocallback, .nofree, .nosync, .nounwind, .willreturn, .{ .memory = .all(.none) } },
3896 },4169 },
3897 .@"load.relative" = .{4170 .@"load.relative" = .{
3898 .ret_len = 1,4171 .ret_len = 1,
...@@ -3914,7 +4187,7 @@ pub const Intrinsic = enum {...@@ -3914,7 +4187,7 @@ pub const Intrinsic = enum {
3914 .{ .kind = .{ .type = .i1 } },4187 .{ .kind = .{ .type = .i1 } },
3915 .{ .kind = .overloaded },4188 .{ .kind = .overloaded },
3916 },4189 },
3917 .attrs = &.{ .convergent, .nocallback, .nofree, .nosync, .nounwind, .willreturn, .{ .memory = Attribute.Memory.all(.none) } },4190 .attrs = &.{ .convergent, .nocallback, .nofree, .nosync, .nounwind, .willreturn, .{ .memory = .all(.none) } },
3918 },4191 },
3919 .ptrmask = .{4192 .ptrmask = .{
3920 .ret_len = 1,4193 .ret_len = 1,
...@@ -3923,7 +4196,7 @@ pub const Intrinsic = enum {...@@ -3923,7 +4196,7 @@ pub const Intrinsic = enum {
3923 .{ .kind = .{ .matches = 0 } },4196 .{ .kind = .{ .matches = 0 } },
3924 .{ .kind = .overloaded },4197 .{ .kind = .overloaded },
3925 },4198 },
3926 .attrs = &.{ .nocallback, .nofree, .nosync, .nounwind, .speculatable, .willreturn, .{ .memory = Attribute.Memory.all(.none) } },4199 .attrs = &.{ .nocallback, .nofree, .nosync, .nounwind, .speculatable, .willreturn, .{ .memory = .all(.none) } },
3927 },4200 },
3928 .@"threadlocal.address" = .{4201 .@"threadlocal.address" = .{
3929 .ret_len = 1,4202 .ret_len = 1,
...@@ -3931,14 +4204,14 @@ pub const Intrinsic = enum {...@@ -3931,14 +4204,14 @@ pub const Intrinsic = enum {
3931 .{ .kind = .overloaded, .attrs = &.{.nonnull} },4204 .{ .kind = .overloaded, .attrs = &.{.nonnull} },
3932 .{ .kind = .{ .matches = 0 }, .attrs = &.{.nonnull} },4205 .{ .kind = .{ .matches = 0 }, .attrs = &.{.nonnull} },
3933 },4206 },
3934 .attrs = &.{ .nocallback, .nofree, .nosync, .nounwind, .speculatable, .willreturn, .{ .memory = Attribute.Memory.all(.none) } },4207 .attrs = &.{ .nocallback, .nofree, .nosync, .nounwind, .speculatable, .willreturn, .{ .memory = .all(.none) } },
3935 },4208 },
3936 .vscale = .{4209 .vscale = .{
3937 .ret_len = 1,4210 .ret_len = 1,
3938 .params = &.{4211 .params = &.{
3939 .{ .kind = .overloaded },4212 .{ .kind = .overloaded },
3940 },4213 },
3941 .attrs = &.{ .nocallback, .nofree, .nosync, .nounwind, .willreturn, .{ .memory = Attribute.Memory.all(.none) } },4214 .attrs = &.{ .nocallback, .nofree, .nosync, .nounwind, .willreturn, .{ .memory = .all(.none) } },
3942 },4215 },
39434216
3944 .@"dbg.declare" = .{4217 .@"dbg.declare" = .{
...@@ -3948,7 +4221,7 @@ pub const Intrinsic = enum {...@@ -3948,7 +4221,7 @@ pub const Intrinsic = enum {
3948 .{ .kind = .{ .type = .metadata } },4221 .{ .kind = .{ .type = .metadata } },
3949 .{ .kind = .{ .type = .metadata } },4222 .{ .kind = .{ .type = .metadata } },
3950 },4223 },
3951 .attrs = &.{ .nocallback, .nofree, .nosync, .nounwind, .speculatable, .willreturn, .{ .memory = Attribute.Memory.all(.none) } },4224 .attrs = &.{ .nocallback, .nofree, .nosync, .nounwind, .speculatable, .willreturn, .{ .memory = .all(.none) } },
3952 },4225 },
3953 .@"dbg.value" = .{4226 .@"dbg.value" = .{
3954 .ret_len = 0,4227 .ret_len = 0,
...@@ -3957,7 +4230,7 @@ pub const Intrinsic = enum {...@@ -3957,7 +4230,7 @@ pub const Intrinsic = enum {
3957 .{ .kind = .{ .type = .metadata } },4230 .{ .kind = .{ .type = .metadata } },
3958 .{ .kind = .{ .type = .metadata } },4231 .{ .kind = .{ .type = .metadata } },
3959 },4232 },
3960 .attrs = &.{ .nocallback, .nofree, .nosync, .nounwind, .speculatable, .willreturn, .{ .memory = Attribute.Memory.all(.none) } },4233 .attrs = &.{ .nocallback, .nofree, .nosync, .nounwind, .speculatable, .willreturn, .{ .memory = .all(.none) } },
3961 },4234 },
39624235
3963 .@"amdgcn.workitem.id.x" = .{4236 .@"amdgcn.workitem.id.x" = .{
...@@ -3965,42 +4238,42 @@ pub const Intrinsic = enum {...@@ -3965,42 +4238,42 @@ pub const Intrinsic = enum {
3965 .params = &.{4238 .params = &.{
3966 .{ .kind = .{ .type = .i32 } },4239 .{ .kind = .{ .type = .i32 } },
3967 },4240 },
3968 .attrs = &.{ .nocallback, .nofree, .nosync, .nounwind, .speculatable, .willreturn, .{ .memory = Attribute.Memory.all(.none) } },4241 .attrs = &.{ .nocallback, .nofree, .nosync, .nounwind, .speculatable, .willreturn, .{ .memory = .all(.none) } },
3969 },4242 },
3970 .@"amdgcn.workitem.id.y" = .{4243 .@"amdgcn.workitem.id.y" = .{
3971 .ret_len = 1,4244 .ret_len = 1,
3972 .params = &.{4245 .params = &.{
3973 .{ .kind = .{ .type = .i32 } },4246 .{ .kind = .{ .type = .i32 } },
3974 },4247 },
3975 .attrs = &.{ .nocallback, .nofree, .nosync, .nounwind, .speculatable, .willreturn, .{ .memory = Attribute.Memory.all(.none) } },4248 .attrs = &.{ .nocallback, .nofree, .nosync, .nounwind, .speculatable, .willreturn, .{ .memory = .all(.none) } },
3976 },4249 },
3977 .@"amdgcn.workitem.id.z" = .{4250 .@"amdgcn.workitem.id.z" = .{
3978 .ret_len = 1,4251 .ret_len = 1,
3979 .params = &.{4252 .params = &.{
3980 .{ .kind = .{ .type = .i32 } },4253 .{ .kind = .{ .type = .i32 } },
3981 },4254 },
3982 .attrs = &.{ .nocallback, .nofree, .nosync, .nounwind, .speculatable, .willreturn, .{ .memory = Attribute.Memory.all(.none) } },4255 .attrs = &.{ .nocallback, .nofree, .nosync, .nounwind, .speculatable, .willreturn, .{ .memory = .all(.none) } },
3983 },4256 },
3984 .@"amdgcn.workgroup.id.x" = .{4257 .@"amdgcn.workgroup.id.x" = .{
3985 .ret_len = 1,4258 .ret_len = 1,
3986 .params = &.{4259 .params = &.{
3987 .{ .kind = .{ .type = .i32 } },4260 .{ .kind = .{ .type = .i32 } },
3988 },4261 },
3989 .attrs = &.{ .nocallback, .nofree, .nosync, .nounwind, .speculatable, .willreturn, .{ .memory = Attribute.Memory.all(.none) } },4262 .attrs = &.{ .nocallback, .nofree, .nosync, .nounwind, .speculatable, .willreturn, .{ .memory = .all(.none) } },
3990 },4263 },
3991 .@"amdgcn.workgroup.id.y" = .{4264 .@"amdgcn.workgroup.id.y" = .{
3992 .ret_len = 1,4265 .ret_len = 1,
3993 .params = &.{4266 .params = &.{
3994 .{ .kind = .{ .type = .i32 } },4267 .{ .kind = .{ .type = .i32 } },
3995 },4268 },
3996 .attrs = &.{ .nocallback, .nofree, .nosync, .nounwind, .speculatable, .willreturn, .{ .memory = Attribute.Memory.all(.none) } },4269 .attrs = &.{ .nocallback, .nofree, .nosync, .nounwind, .speculatable, .willreturn, .{ .memory = .all(.none) } },
3997 },4270 },
3998 .@"amdgcn.workgroup.id.z" = .{4271 .@"amdgcn.workgroup.id.z" = .{
3999 .ret_len = 1,4272 .ret_len = 1,
4000 .params = &.{4273 .params = &.{
4001 .{ .kind = .{ .type = .i32 } },4274 .{ .kind = .{ .type = .i32 } },
4002 },4275 },
4003 .attrs = &.{ .nocallback, .nofree, .nosync, .nounwind, .speculatable, .willreturn, .{ .memory = Attribute.Memory.all(.none) } },4276 .attrs = &.{ .nocallback, .nofree, .nosync, .nounwind, .speculatable, .willreturn, .{ .memory = .all(.none) } },
4004 },4277 },
4005 .@"amdgcn.dispatch.ptr" = .{4278 .@"amdgcn.dispatch.ptr" = .{
4006 .ret_len = 1,4279 .ret_len = 1,
...@@ -4010,7 +4283,7 @@ pub const Intrinsic = enum {...@@ -4010,7 +4283,7 @@ pub const Intrinsic = enum {
4010 .attrs = &.{.{ .@"align" = .wrap(.fromByteUnits(4)) }},4283 .attrs = &.{.{ .@"align" = .wrap(.fromByteUnits(4)) }},
4011 },4284 },
4012 },4285 },
4013 .attrs = &.{ .nocallback, .nofree, .nosync, .nounwind, .speculatable, .willreturn, .{ .memory = Attribute.Memory.all(.none) } },4286 .attrs = &.{ .nocallback, .nofree, .nosync, .nounwind, .speculatable, .willreturn, .{ .memory = .all(.none) } },
4014 },4287 },
40154288
4016 .@"nvvm.read.ptx.sreg.tid.x" = .{4289 .@"nvvm.read.ptx.sreg.tid.x" = .{
...@@ -4085,7 +4358,7 @@ pub const Intrinsic = enum {...@@ -4085,7 +4358,7 @@ pub const Intrinsic = enum {
4085 .{ .kind = .overloaded },4358 .{ .kind = .overloaded },
4086 .{ .kind = .{ .type = .i32 } },4359 .{ .kind = .{ .type = .i32 } },
4087 },4360 },
4088 .attrs = &.{ .nocallback, .nofree, .nosync, .nounwind, .willreturn, .{ .memory = Attribute.Memory.all(.none) } },4361 .attrs = &.{ .nocallback, .nofree, .nosync, .nounwind, .willreturn, .{ .memory = .all(.none) } },
4089 },4362 },
4090 .@"wasm.memory.grow" = .{4363 .@"wasm.memory.grow" = .{
4091 .ret_len = 1,4364 .ret_len = 1,
...@@ -4166,6 +4439,10 @@ pub const Function = struct {...@@ -4166,6 +4439,10 @@ pub const Function = struct {
4166 self.ptr(builder).attributes = new_function_attributes;4439 self.ptr(builder).attributes = new_function_attributes;
4167 }4440 }
41684441
4442 pub fn getAttributes(self: Index, builder: *Builder) FunctionAttributes {
4443 return self.ptr(builder).attributes;
4444 }
4445
4169 pub fn setSection(self: Index, section: String, builder: *Builder) void {4446 pub fn setSection(self: Index, section: String, builder: *Builder) void {
4170 self.ptr(builder).section = section;4447 self.ptr(builder).section = section;
4171 }4448 }
...@@ -4487,7 +4764,7 @@ pub const Function = struct {...@@ -4487,7 +4764,7 @@ pub const Function = struct {
4487 }4764 }
44884765
4489 pub fn toValue(self: Instruction.Index) Value {4766 pub fn toValue(self: Instruction.Index) Value {
4490 return @fromBackingInt(@intCast(@backingInt(self)));4767 return @fromBackingInt(@backingInt(self));
4491 }4768 }
44924769
4493 pub fn isTerminatorWip(self: Instruction.Index, wip: *const WipFunction) bool {4770 pub fn isTerminatorWip(self: Instruction.Index, wip: *const WipFunction) bool {
...@@ -4679,7 +4956,7 @@ pub const Function = struct {...@@ -4679,7 +4956,7 @@ pub const Function = struct {
4679 .changeScalarAssumeCapacity(.i1, wip.builder),4956 .changeScalarAssumeCapacity(.i1, wip.builder),
4680 .fneg,4957 .fneg,
4681 .@"fneg fast",4958 .@"fneg fast",
4682 => @as(Value, @fromBackingInt(@intCast(instruction.data))).typeOfWip(wip),4959 => @as(Value, @fromBackingInt(instruction.data)).typeOfWip(wip),
4683 .getelementptr,4960 .getelementptr,
4684 .@"getelementptr inbounds",4961 .@"getelementptr inbounds",
4685 => {4962 => {
...@@ -4871,7 +5148,7 @@ pub const Function = struct {...@@ -4871,7 +5148,7 @@ pub const Function = struct {
4871 .changeScalarAssumeCapacity(.i1, builder),5148 .changeScalarAssumeCapacity(.i1, builder),
4872 .fneg,5149 .fneg,
4873 .@"fneg fast",5150 .@"fneg fast",
4874 => @as(Value, @fromBackingInt(@intCast(instruction.data))).typeOf(function_index, builder),5151 => @as(Value, @fromBackingInt(instruction.data)).typeOf(function_index, builder),
4875 .getelementptr,5152 .getelementptr,
4876 .@"getelementptr inbounds",5153 .@"getelementptr inbounds",
4877 => {5154 => {
...@@ -4963,7 +5240,7 @@ pub const Function = struct {...@@ -4963,7 +5240,7 @@ pub const Function = struct {
49635240
4964 pub fn fromMetadata(metadata: Metadata) Weights {5241 pub fn fromMetadata(metadata: Metadata) Weights {
4965 assert(metadata.kind == .node);5242 assert(metadata.kind == .node);
4966 return @fromBackingInt(@intCast(metadata.index));5243 return @fromBackingInt(metadata.index);
4967 }5244 }
49685245
4969 pub fn toMetadata(weights: Weights) Metadata {5246 pub fn toMetadata(weights: Weights) Metadata {
...@@ -5156,7 +5433,7 @@ pub const Function = struct {...@@ -5156,7 +5433,7 @@ pub const Function = struct {
5156 assert(argument.tag == .arg);5433 assert(argument.tag == .arg);
5157 assert(argument.data == index);5434 assert(argument.data == index);
51585435
5159 const argument_index: Instruction.Index = @fromBackingInt(@intCast(index));5436 const argument_index: Instruction.Index = @fromBackingInt(index);
5160 return argument_index.toValue();5437 return argument_index.toValue();
5161 }5438 }
51625439
...@@ -5202,7 +5479,7 @@ pub const Function = struct {...@@ -5202,7 +5479,7 @@ pub const Function = struct {
5202 Type,5479 Type,
5203 Value,5480 Value,
5204 Instruction.BrCond.Weights,5481 Instruction.BrCond.Weights,
5205 => @fromBackingInt(@intCast(value)),5482 => @fromBackingInt(value),
5206 MemoryAccessInfo,5483 MemoryAccessInfo,
5207 Instruction.Alloca.Info,5484 Instruction.Alloca.Info,
5208 Instruction.Call.Info,5485 Instruction.Call.Info,
...@@ -5327,7 +5604,7 @@ pub const WipFunction = struct {...@@ -5327,7 +5604,7 @@ pub const WipFunction = struct {
5327 assert(argument.tag == .arg);5604 assert(argument.tag == .arg);
5328 assert(argument.data == index);5605 assert(argument.data == index);
53295606
5330 const argument_index: Instruction.Index = @fromBackingInt(@intCast(index));5607 const argument_index: Instruction.Index = @fromBackingInt(index);
5331 return argument_index.toValue();5608 return argument_index.toValue();
5332 }5609 }
53335610
...@@ -6414,24 +6691,24 @@ pub const WipFunction = struct {...@@ -6414,24 +6691,24 @@ pub const WipFunction = struct {
6414 errdefer function.instructions.shrinkRetainingCapacity(0);6691 errdefer function.instructions.shrinkRetainingCapacity(0);
64156692
6416 {6693 {
6417 var final_instruction_index: Instruction.Index = @fromBackingInt(@intCast(0));6694 var final_instruction_index: Instruction.Index = @fromBackingInt(0);
6418 for (0..params_len) |param_index| {6695 for (0..params_len) |param_index| {
6419 instructions.items[param_index] = final_instruction_index;6696 instructions.items[param_index] = final_instruction_index;
6420 final_instruction_index = @fromBackingInt(@intCast(@backingInt(final_instruction_index) + 1));6697 final_instruction_index = @fromBackingInt(@backingInt(final_instruction_index) + 1);
6421 }6698 }
6422 for (blocks, self.blocks.items) |*final_block, current_block| {6699 for (blocks, self.blocks.items) |*final_block, current_block| {
6423 assert(current_block.incoming == current_block.branches);6700 assert(current_block.incoming == current_block.branches);
6424 final_block.instruction = final_instruction_index;6701 final_block.instruction = final_instruction_index;
6425 final_instruction_index = @fromBackingInt(@intCast(@backingInt(final_instruction_index) + 1));6702 final_instruction_index = @fromBackingInt(@backingInt(final_instruction_index) + 1);
6426 for (current_block.instructions.items) |instruction| {6703 for (current_block.instructions.items) |instruction| {
6427 instructions.items[@backingInt(instruction)] = final_instruction_index;6704 instructions.items[@backingInt(instruction)] = final_instruction_index;
6428 final_instruction_index = @fromBackingInt(@intCast(@backingInt(final_instruction_index) + 1));6705 final_instruction_index = @fromBackingInt(@backingInt(final_instruction_index) + 1);
6429 }6706 }
6430 }6707 }
6431 }6708 }
64326709
6433 var wip_name: struct {6710 var wip_name: struct {
6434 next_name: String = @fromBackingInt(@intCast(0)),6711 next_name: String = @fromBackingInt(0),
6435 next_unique_name: std.AutoHashMap(String, String),6712 next_unique_name: std.AutoHashMap(String, String),
6436 builder: *Builder,6713 builder: *Builder,
64376714
...@@ -6440,19 +6717,19 @@ pub const WipFunction = struct {...@@ -6440,19 +6717,19 @@ pub const WipFunction = struct {
6440 .none => return .none,6717 .none => return .none,
6441 .empty => {6718 .empty => {
6442 assert(wip_name.next_name != .none);6719 assert(wip_name.next_name != .none);
6443 defer wip_name.next_name = @fromBackingInt(@intCast(@backingInt(wip_name.next_name) + 1));6720 defer wip_name.next_name = @fromBackingInt(@backingInt(wip_name.next_name) + 1);
6444 return wip_name.next_name;6721 return wip_name.next_name;
6445 },6722 },
6446 _ => {6723 _ => {
6447 assert(!name.isAnon());6724 assert(!name.isAnon());
6448 const gop = try wip_name.next_unique_name.getOrPut(name);6725 const gop = try wip_name.next_unique_name.getOrPut(name);
6449 if (!gop.found_existing) {6726 if (!gop.found_existing) {
6450 gop.value_ptr.* = @fromBackingInt(@intCast(0));6727 gop.value_ptr.* = @fromBackingInt(0);
6451 return name;6728 return name;
6452 }6729 }
64536730
6454 while (true) {6731 while (true) {
6455 gop.value_ptr.* = @fromBackingInt(@intCast(@backingInt(gop.value_ptr.*) + 1));6732 gop.value_ptr.* = @fromBackingInt(@backingInt(gop.value_ptr.*) + 1);
6456 const unique_name = try wip_name.builder.fmt("{f}{s}{f}", .{6733 const unique_name = try wip_name.builder.fmt("{f}{s}{f}", .{
6457 name.fmtRaw(wip_name.builder),6734 name.fmtRaw(wip_name.builder),
6458 sep,6735 sep,
...@@ -6460,7 +6737,7 @@ pub const WipFunction = struct {...@@ -6460,7 +6737,7 @@ pub const WipFunction = struct {
6460 });6737 });
6461 const unique_gop = try wip_name.next_unique_name.getOrPut(unique_name);6738 const unique_gop = try wip_name.next_unique_name.getOrPut(unique_name);
6462 if (!unique_gop.found_existing) {6739 if (!unique_gop.found_existing) {
6463 unique_gop.value_ptr.* = @fromBackingInt(@intCast(0));6740 unique_gop.value_ptr.* = @fromBackingInt(0);
6464 return unique_name;6741 return unique_name;
6465 }6742 }
6466 }6743 }
...@@ -6702,7 +6979,7 @@ pub const WipFunction = struct {...@@ -6702,7 +6979,7 @@ pub const WipFunction = struct {
6702 .fneg,6979 .fneg,
6703 .@"fneg fast",6980 .@"fneg fast",
6704 .ret,6981 .ret,
6705 => instruction.data = @backingInt(instructions.map(@fromBackingInt(@intCast(instruction.data)))),6982 => instruction.data = @backingInt(instructions.map(@fromBackingInt(instruction.data))),
6706 .getelementptr,6983 .getelementptr,
6707 .@"getelementptr inbounds",6984 .@"getelementptr inbounds",
6708 => {6985 => {
...@@ -7079,7 +7356,7 @@ pub const WipFunction = struct {...@@ -7079,7 +7356,7 @@ pub const WipFunction = struct {
7079 Type,7356 Type,
7080 Value,7357 Value,
7081 Instruction.BrCond.Weights,7358 Instruction.BrCond.Weights,
7082 => @fromBackingInt(@intCast(value)),7359 => @fromBackingInt(value),
7083 MemoryAccessInfo,7360 MemoryAccessInfo,
7084 Instruction.Alloca.Info,7361 Instruction.Alloca.Info,
7085 Instruction.Call.Info,7362 Instruction.Call.Info,
...@@ -7268,7 +7545,7 @@ pub const Constant = enum(u32) {...@@ -7268,7 +7545,7 @@ pub const Constant = enum(u32) {
7268 no_init = (1 << 30) - 1,7545 no_init = (1 << 30) - 1,
7269 _,7546 _,
72707547
7271 const first_global: Constant = @fromBackingInt(@intCast(1 << 29));7548 const first_global: Constant = @fromBackingInt(1 << 29);
72727549
7273 pub const Tag = enum(u7) {7550 pub const Tag = enum(u7) {
7274 positive_integer,7551 positive_integer,
...@@ -7405,7 +7682,18 @@ pub const Constant = enum(u32) {...@@ -7405,7 +7682,18 @@ pub const Constant = enum(u32) {
7405 val: Constant,7682 val: Constant,
7406 type: Type,7683 type: Type,
74077684
7408 pub const Signedness = enum { unsigned, signed, unneeded };7685 pub const Signedness = enum {
7686 unsigned,
7687 signed,
7688 unneeded,
7689
7690 pub fn fromStdLang(signedness: std.lang.Signedness) Signedness {
7691 return switch (signedness) {
7692 .unsigned => .unsigned,
7693 .signed => .signed,
7694 };
7695 }
7696 };
7409 };7697 };
74107698
7411 pub const GetElementPtr = struct {7699 pub const GetElementPtr = struct {
...@@ -7444,11 +7732,11 @@ pub const Constant = enum(u32) {...@@ -7444,11 +7732,11 @@ pub const Constant = enum(u32) {
7444 return if (@backingInt(self) < @backingInt(first_global))7732 return if (@backingInt(self) < @backingInt(first_global))
7445 .{ .constant = @intCast(@backingInt(self)) }7733 .{ .constant = @intCast(@backingInt(self)) }
7446 else7734 else
7447 .{ .global = @fromBackingInt(@intCast(@backingInt(self) - @backingInt(first_global))) };7735 .{ .global = @fromBackingInt(@backingInt(self) - @backingInt(first_global)) };
7448 }7736 }
74497737
7450 pub fn toValue(self: Constant) Value {7738 pub fn toValue(self: Constant) Value {
7451 return @fromBackingInt(@intCast(Value.first_constant + @backingInt(self)));7739 return @fromBackingInt(Value.first_constant + @backingInt(self));
7452 }7740 }
74537741
7454 pub fn typeOf(self: Constant, builder: *Builder) Type {7742 pub fn typeOf(self: Constant, builder: *Builder) Type {
...@@ -7474,7 +7762,7 @@ pub const Constant = enum(u32) {...@@ -7474,7 +7762,7 @@ pub const Constant = enum(u32) {
7474 .zeroinitializer,7762 .zeroinitializer,
7475 .undef,7763 .undef,
7476 .poison,7764 .poison,
7477 => @fromBackingInt(@intCast(item.data)),7765 => @fromBackingInt(item.data),
7478 .structure,7766 .structure,
7479 .packed_structure,7767 .packed_structure,
7480 .array,7768 .array,
...@@ -7482,7 +7770,7 @@ pub const Constant = enum(u32) {...@@ -7482,7 +7770,7 @@ pub const Constant = enum(u32) {
7482 => builder.constantExtraData(Aggregate, item.data).type,7770 => builder.constantExtraData(Aggregate, item.data).type,
7483 .splat => builder.constantExtraData(Splat, item.data).type,7771 .splat => builder.constantExtraData(Splat, item.data).type,
7484 .string => builder.arrayTypeAssumeCapacity(7772 .string => builder.arrayTypeAssumeCapacity(
7485 @as(String, @fromBackingInt(@intCast(item.data))).slice(builder).?.len,7773 @as(String, @fromBackingInt(item.data)).slice(builder).?.len,
7486 .i8,7774 .i8,
7487 ),7775 ),
7488 .blockaddress => builder.ptrTypeAssumeCapacity(7776 .blockaddress => builder.ptrTypeAssumeCapacity(
...@@ -7491,7 +7779,7 @@ pub const Constant = enum(u32) {...@@ -7491,7 +7779,7 @@ pub const Constant = enum(u32) {
7491 ),7779 ),
7492 .dso_local_equivalent,7780 .dso_local_equivalent,
7493 .no_cfi,7781 .no_cfi,
7494 => builder.ptrTypeAssumeCapacity(@as(Function.Index, @fromBackingInt(@intCast(item.data)))7782 => builder.ptrTypeAssumeCapacity(@as(Function.Index, @fromBackingInt(item.data))
7495 .ptrConst(builder).global.ptrConst(builder).addr_space),7783 .ptrConst(builder).global.ptrConst(builder).addr_space),
7496 .trunc,7784 .trunc,
7497 .ptrtoint,7785 .ptrtoint,
...@@ -7802,7 +8090,7 @@ pub const Constant = enum(u32) {...@@ -7802,7 +8090,7 @@ pub const Constant = enum(u32) {
7802 try w.writeByte('>');8090 try w.writeByte('>');
7803 },8091 },
7804 .string => try w.print("c{f}", .{8092 .string => try w.print("c{f}", .{
7805 @as(String, @fromBackingInt(@intCast(item.data))).fmtQ(data.builder),8093 @as(String, @fromBackingInt(item.data)).fmtQ(data.builder),
7806 }),8094 }),
7807 .blockaddress => |tag| {8095 .blockaddress => |tag| {
7808 const extra = data.builder.constantExtraData(BlockAddress, item.data);8096 const extra = data.builder.constantExtraData(BlockAddress, item.data);
...@@ -7816,7 +8104,7 @@ pub const Constant = enum(u32) {...@@ -7816,7 +8104,7 @@ pub const Constant = enum(u32) {
7816 .dso_local_equivalent,8104 .dso_local_equivalent,
7817 .no_cfi,8105 .no_cfi,
7818 => |tag| {8106 => |tag| {
7819 const function: Function.Index = @fromBackingInt(@intCast(item.data));8107 const function: Function.Index = @fromBackingInt(item.data);
7820 try w.print("{s} {f}", .{8108 try w.print("{s} {f}", .{
7821 @tagName(tag),8109 @tagName(tag),
7822 function.ptrConst(data.builder).global.fmt(data.builder),8110 function.ptrConst(data.builder).global.fmt(data.builder),
...@@ -7920,9 +8208,9 @@ pub const Value = enum(u32) {...@@ -7920,9 +8208,9 @@ pub const Value = enum(u32) {
7920 metadata: Metadata,8208 metadata: Metadata,
7921 } {8209 } {
7922 return if (@backingInt(self) < first_constant)8210 return if (@backingInt(self) < first_constant)
7923 .{ .instruction = @fromBackingInt(@intCast(@backingInt(self))) }8211 .{ .instruction = @fromBackingInt(@backingInt(self)) }
7924 else if (@backingInt(self) < first_metadata)8212 else if (@backingInt(self) < first_metadata)
7925 .{ .constant = @fromBackingInt(@intCast(@backingInt(self) - first_constant)) }8213 .{ .constant = @fromBackingInt(@backingInt(self) - first_constant) }
7926 else8214 else
7927 .{ .metadata = @bitCast(@backingInt(self) - first_metadata) };8215 .{ .metadata = @bitCast(@backingInt(self) - first_metadata) };
7928 }8216 }
...@@ -8016,7 +8304,7 @@ pub const Metadata = packed struct(u32) {...@@ -8016,7 +8304,7 @@ pub const Metadata = packed struct(u32) {
8016 return .{ .index = metadata.index, .kind = metadata.kind, .is_none = false };8304 return .{ .index = metadata.index, .kind = metadata.kind, .is_none = false };
8017 }8305 }
8018 pub fn toValue(metadata: Metadata) Value {8306 pub fn toValue(metadata: Metadata) Value {
8019 return @fromBackingInt(@intCast(Value.first_metadata + @as(u32, @bitCast(metadata))));8307 return @fromBackingInt(Value.first_metadata + @as(u32, @bitCast(metadata)));
8020 }8308 }
80218309
8022 pub const String = enum(u32) {8310 pub const String = enum(u32) {
...@@ -8032,7 +8320,7 @@ pub const Metadata = packed struct(u32) {...@@ -8032,7 +8320,7 @@ pub const Metadata = packed struct(u32) {
8032 pub fn unwrap(metadata: Metadata.String.Optional) ?Metadata.String {8320 pub fn unwrap(metadata: Metadata.String.Optional) ?Metadata.String {
8033 return switch (metadata) {8321 return switch (metadata) {
8034 .none => null,8322 .none => null,
8035 else => @fromBackingInt(@intCast(@backingInt(metadata))),8323 else => @fromBackingInt(@backingInt(metadata)),
8036 };8324 };
8037 }8325 }
8038 pub fn toMetadata(metadata: Metadata.String.Optional) Metadata.Optional {8326 pub fn toMetadata(metadata: Metadata.String.Optional) Metadata.Optional {
...@@ -8040,7 +8328,7 @@ pub const Metadata = packed struct(u32) {...@@ -8040,7 +8328,7 @@ pub const Metadata = packed struct(u32) {
8040 }8328 }
8041 };8329 };
8042 pub fn toOptional(metadata: Metadata.String) Metadata.String.Optional {8330 pub fn toOptional(metadata: Metadata.String) Metadata.String.Optional {
8043 return @fromBackingInt(@intCast(@backingInt(metadata)));8331 return @fromBackingInt(@backingInt(metadata));
8044 }8332 }
8045 pub fn toMetadata(metadata: Metadata.String) Metadata {8333 pub fn toMetadata(metadata: Metadata.String) Metadata {
8046 return .{ .index = @intCast(@backingInt(metadata)), .kind = .string };8334 return .{ .index = @intCast(@backingInt(metadata)), .kind = .string };
...@@ -8077,7 +8365,7 @@ pub const Metadata = packed struct(u32) {...@@ -8077,7 +8365,7 @@ pub const Metadata = packed struct(u32) {
8077 };8365 };
8078 pub fn toString(metadata: Metadata) Metadata.String {8366 pub fn toString(metadata: Metadata) Metadata.String {
8079 assert(metadata.kind == .string);8367 assert(metadata.kind == .string);
8080 return @fromBackingInt(@intCast(metadata.index));8368 return @fromBackingInt(metadata.index);
8081 }8369 }
80828370
8083 pub const Tag = enum(u6) {8371 pub const Tag = enum(u6) {
...@@ -8542,7 +8830,7 @@ pub const Metadata = packed struct(u32) {...@@ -8542,7 +8830,7 @@ pub const Metadata = packed struct(u32) {
8542 try w.writeByte(')');8830 try w.writeByte(')');
8543 },8831 },
8544 .constant => try Constant.format(.{8832 .constant => try Constant.format(.{
8545 .constant = @fromBackingInt(@intCast(node_item.data)),8833 .constant = @fromBackingInt(node_item.data),
8546 .builder = builder,8834 .builder = builder,
8547 .flags = data.specialized orelse .{},8835 .flags = data.specialized orelse .{},
8548 }, w),8836 }, w),
...@@ -8744,7 +9032,7 @@ pub fn init(options: Options) Allocator.Error!Builder {...@@ -8744,7 +9032,7 @@ pub fn init(options: Options) Allocator.Error!Builder {
8744 .string_bytes = .empty,9032 .string_bytes = .empty,
87459033
8746 .types = .empty,9034 .types = .empty,
8747 .next_unnamed_type = @fromBackingInt(@intCast(0)),9035 .next_unnamed_type = @fromBackingInt(0),
8748 .next_unique_type_id = .empty,9036 .next_unique_type_id = .empty,
8749 .type_map = .empty,9037 .type_map = .empty,
8750 .type_items = .empty,9038 .type_items = .empty,
...@@ -8758,7 +9046,7 @@ pub fn init(options: Options) Allocator.Error!Builder {...@@ -8758,7 +9046,7 @@ pub fn init(options: Options) Allocator.Error!Builder {
8758 .function_attributes_set = .empty,9046 .function_attributes_set = .empty,
87599047
8760 .globals = .empty,9048 .globals = .empty,
8761 .next_unnamed_global = @fromBackingInt(@intCast(0)),9049 .next_unnamed_global = @fromBackingInt(0),
8762 .next_replaced_global = .none,9050 .next_replaced_global = .none,
8763 .next_unique_global_id = .empty,9051 .next_unique_global_id = .empty,
8764 .aliases = .empty,9052 .aliases = .empty,
...@@ -8815,7 +9103,7 @@ pub fn init(options: Options) Allocator.Error!Builder {...@@ -8815,7 +9103,7 @@ pub fn init(options: Options) Allocator.Error!Builder {
8815 assert(self.intTypeAssumeCapacity(bits) ==9103 assert(self.intTypeAssumeCapacity(bits) ==
8816 @field(Type, std.fmt.comptimePrint("i{d}", .{bits})));9104 @field(Type, std.fmt.comptimePrint("i{d}", .{bits})));
8817 inline for (.{ 0, 4 }) |addr_space_index| {9105 inline for (.{ 0, 4 }) |addr_space_index| {
8818 const addr_space: AddrSpace = @fromBackingInt(@intCast(addr_space_index));9106 const addr_space: AddrSpace = @fromBackingInt(addr_space_index);
8819 assert(self.ptrTypeAssumeCapacity(addr_space) ==9107 assert(self.ptrTypeAssumeCapacity(addr_space) ==
8820 @field(Type, std.fmt.comptimePrint("ptr{f}", .{addr_space.fmt(" ")})));9108 @field(Type, std.fmt.comptimePrint("ptr{f}", .{addr_space.fmt(" ")})));
8821 }9109 }
...@@ -9092,17 +9380,17 @@ pub fn attrs(self: *Builder, attributes: []Attribute.Index) Allocator.Error!Attr...@@ -9092,17 +9380,17 @@ pub fn attrs(self: *Builder, attributes: []Attribute.Index) Allocator.Error!Attr
9092 return @backingInt(lhs_kind) < @backingInt(rhs_kind);9380 return @backingInt(lhs_kind) < @backingInt(rhs_kind);
9093 }9381 }
9094 }.lessThan);9382 }.lessThan);
9095 return @fromBackingInt(@intCast(try self.attrGeneric(@ptrCast(attributes))));9383 return @fromBackingInt(try self.attrGeneric(@ptrCast(attributes)));
9096}9384}
90979385
9098pub fn fnAttrs(self: *Builder, fn_attributes: []const Attributes) Allocator.Error!FunctionAttributes {9386pub fn fnAttrs(self: *Builder, fn_attributes: []const Attributes) Allocator.Error!FunctionAttributes {
9099 try self.function_attributes_set.ensureUnusedCapacity(self.gpa, 1);9387 try self.function_attributes_set.ensureUnusedCapacity(self.gpa, 1);
9100 const function_attributes: FunctionAttributes = @fromBackingInt(@intCast(try self.attrGeneric(@ptrCast(9388 const function_attributes: FunctionAttributes = @fromBackingInt(try self.attrGeneric(@ptrCast(
9101 fn_attributes[0..if (std.mem.lastIndexOfNone(Attributes, fn_attributes, &.{.none})) |last|9389 fn_attributes[0..if (std.mem.lastIndexOfNone(Attributes, fn_attributes, &.{.none})) |last|
9102 last + 19390 last + 1
9103 else9391 else
9104 0],9392 0],
9105 ))));9393 )));
91069394
9107 _ = self.function_attributes_set.getOrPutAssumeCapacity(function_attributes);9395 _ = self.function_attributes_set.getOrPutAssumeCapacity(function_attributes);
9108 return function_attributes;9396 return function_attributes;
...@@ -9121,7 +9409,7 @@ pub fn addGlobalAssumeCapacity(self: *Builder, name: StrtabString, global: Globa...@@ -9121,7 +9409,7 @@ pub fn addGlobalAssumeCapacity(self: *Builder, name: StrtabString, global: Globa
9121 if (name == .empty) {9409 if (name == .empty) {
9122 id = self.next_unnamed_global;9410 id = self.next_unnamed_global;
9123 assert(id != self.next_replaced_global);9411 assert(id != self.next_replaced_global);
9124 self.next_unnamed_global = @fromBackingInt(@intCast(@backingInt(id) + 1));9412 self.next_unnamed_global = @fromBackingInt(@backingInt(id) + 1);
9125 }9413 }
9126 while (true) {9414 while (true) {
9127 const global_gop = self.globals.getOrPutAssumeCapacity(id);9415 const global_gop = self.globals.getOrPutAssumeCapacity(id);
...@@ -10058,7 +10346,7 @@ pub fn print(self: *Builder, w: *Writer) (Writer.Error || Allocator.Error)!void...@@ -10058,7 +10346,7 @@ pub fn print(self: *Builder, w: *Writer) (Writer.Error || Allocator.Error)!void
10058 continue;10346 continue;
10059 },10347 },
10060 .br => |tag| {10348 .br => |tag| {
10061 const target: Function.Block.Index = @fromBackingInt(@intCast(instruction.data));10349 const target: Function.Block.Index = @fromBackingInt(instruction.data);
10062 try w.print(" {s} {f}", .{10350 try w.print(" {s} {f}", .{
10063 @tagName(tag), target.toInst(&function).fmt(function_index, self, .{ .percent = true }),10351 @tagName(tag), target.toInst(&function).fmt(function_index, self, .{ .percent = true }),
10064 });10352 });
...@@ -10187,7 +10475,7 @@ pub fn print(self: *Builder, w: *Writer) (Writer.Error || Allocator.Error)!void...@@ -10187,7 +10475,7 @@ pub fn print(self: *Builder, w: *Writer) (Writer.Error || Allocator.Error)!void
10187 .fneg,10475 .fneg,
10188 .@"fneg fast",10476 .@"fneg fast",
10189 => |tag| {10477 => |tag| {
10190 const val: Value = @fromBackingInt(@intCast(instruction.data));10478 const val: Value = @fromBackingInt(instruction.data);
10191 try w.print(" %{f} = {s} {f}", .{10479 try w.print(" %{f} = {s} {f}", .{
10192 instruction_index.name(&function).fmt(self),10480 instruction_index.name(&function).fmt(self),
10193 @tagName(tag),10481 @tagName(tag),
...@@ -10288,7 +10576,7 @@ pub fn print(self: *Builder, w: *Writer) (Writer.Error || Allocator.Error)!void...@@ -10288,7 +10576,7 @@ pub fn print(self: *Builder, w: *Writer) (Writer.Error || Allocator.Error)!void
10288 }10576 }
10289 },10577 },
10290 .ret => |tag| {10578 .ret => |tag| {
10291 const val: Value = @fromBackingInt(@intCast(instruction.data));10579 const val: Value = @fromBackingInt(instruction.data);
10292 try w.print(" {s} {f}", .{10580 try w.print(" {s} {f}", .{
10293 @tagName(tag),10581 @tagName(tag),
10294 val.fmt(function_index, self, .{ .percent = true }),10582 val.fmt(function_index, self, .{ .percent = true }),
...@@ -11020,7 +11308,7 @@ fn opaqueTypeAssumeCapacity(self: *Builder, name: String) Type {...@@ -11020,7 +11308,7 @@ fn opaqueTypeAssumeCapacity(self: *Builder, name: String) Type {
11020 if (name == .empty) {11308 if (name == .empty) {
11021 id = self.next_unnamed_type;11309 id = self.next_unnamed_type;
11022 assert(id != .none);11310 assert(id != .none);
11023 self.next_unnamed_type = @fromBackingInt(@intCast(@backingInt(id) + 1));11311 self.next_unnamed_type = @fromBackingInt(@backingInt(id) + 1);
11024 } else assert(!name.isAnon());11312 } else assert(!name.isAnon());
11025 while (true) {11313 while (true) {
11026 const type_gop = self.types.getOrPutAssumeCapacity(id);11314 const type_gop = self.types.getOrPutAssumeCapacity(id);
...@@ -11135,7 +11423,7 @@ fn typeExtraDataTrail(...@@ -11135,7 +11423,7 @@ fn typeExtraDataTrail(
11135 ) |field_name, field_type, value|11423 ) |field_name, field_type, value|
11136 @field(result, field_name) = switch (field_type) {11424 @field(result, field_name) = switch (field_type) {
11137 u32 => value,11425 u32 => value,
11138 String, Type => @fromBackingInt(@intCast(value)),11426 String, Type => @fromBackingInt(value),
11139 else => @compileError("bad field type: " ++ @typeName(field_type)),11427 else => @compileError("bad field type: " ++ @typeName(field_type)),
11140 };11428 };
11141 return .{11429 return .{
...@@ -11746,7 +12034,7 @@ fn castConstAssumeCapacity(self: *Builder, tag: Constant.Tag, val: Constant, ty:...@@ -11746,7 +12034,7 @@ fn castConstAssumeCapacity(self: *Builder, tag: Constant.Tag, val: Constant, ty:
11746 return std.meta.eql(lhs_key.cast, rhs_extra);12034 return std.meta.eql(lhs_key.cast, rhs_extra);
11747 }12035 }
11748 };12036 };
11749 const data = Key{ .tag = tag, .cast = .{ .val = val, .type = ty } };12037 const data: Key = .{ .tag = tag, .cast = .{ .val = val, .type = ty } };
11750 const gop = self.constant_map.getOrPutAssumeCapacityAdapted(data, Adapter{ .builder = self });12038 const gop = self.constant_map.getOrPutAssumeCapacityAdapted(data, Adapter{ .builder = self });
11751 if (!gop.found_existing) {12039 if (!gop.found_existing) {
11752 gop.key_ptr.* = {};12040 gop.key_ptr.* = {};
...@@ -11828,10 +12116,10 @@ fn gepConstAssumeCapacity(...@@ -11828,10 +12116,10 @@ fn gepConstAssumeCapacity(
11828 std.mem.eql(Constant, lhs_key.indices, rhs_indices);12116 std.mem.eql(Constant, lhs_key.indices, rhs_indices);
11829 }12117 }
11830 };12118 };
11831 const data = Key{12119 const data: Key = .{
11832 .type = ty,12120 .type = ty,
11833 .base = base,12121 .base = base,
11834 .inrange = if (inrange) |index| @fromBackingInt(@intCast(index)) else .none,12122 .inrange = if (inrange) |index| @fromBackingInt(index) else .none,
11835 .indices = indices,12123 .indices = indices,
11836 };12124 };
11837 const gop = self.constant_map.getOrPutAssumeCapacityAdapted(data, Adapter{ .builder = self });12125 const gop = self.constant_map.getOrPutAssumeCapacityAdapted(data, Adapter{ .builder = self });
...@@ -11885,7 +12173,7 @@ fn binConstAssumeCapacity(...@@ -11885,7 +12173,7 @@ fn binConstAssumeCapacity(
11885 return std.meta.eql(lhs_key.extra, rhs_extra);12173 return std.meta.eql(lhs_key.extra, rhs_extra);
11886 }12174 }
11887 };12175 };
11888 const data = Key{ .tag = tag, .extra = .{ .lhs = lhs, .rhs = rhs } };12176 const data: Key = .{ .tag = tag, .extra = .{ .lhs = lhs, .rhs = rhs } };
11889 const gop = self.constant_map.getOrPutAssumeCapacityAdapted(data, Adapter{ .builder = self });12177 const gop = self.constant_map.getOrPutAssumeCapacityAdapted(data, Adapter{ .builder = self });
11890 if (!gop.found_existing) {12178 if (!gop.found_existing) {
11891 gop.key_ptr.* = {};12179 gop.key_ptr.* = {};
...@@ -11924,8 +12212,8 @@ fn asmConstAssumeCapacity(...@@ -11924,8 +12212,8 @@ fn asmConstAssumeCapacity(
11924 }12212 }
11925 };12213 };
1192612214
11927 const data = Key{12215 const data: Key = .{
11928 .tag = @fromBackingInt(@intCast(@backingInt(Constant.Tag.@"asm") + @as(u4, @bitCast(info)))),12216 .tag = @fromBackingInt(@backingInt(Constant.Tag.@"asm") + @as(u4, @bitCast(info))),
11929 .extra = .{ .type = ty, .assembly = assembly, .constraints = constraints },12217 .extra = .{ .type = ty, .assembly = assembly, .constraints = constraints },
11930 };12218 };
11931 const gop = self.constant_map.getOrPutAssumeCapacityAdapted(data, Adapter{ .builder = self });12219 const gop = self.constant_map.getOrPutAssumeCapacityAdapted(data, Adapter{ .builder = self });
...@@ -12073,7 +12361,7 @@ fn constantExtraDataTrail(...@@ -12073,7 +12361,7 @@ fn constantExtraDataTrail(
12073 ) |field_name, field_type, value|12361 ) |field_name, field_type, value|
12074 @field(result, field_name) = switch (field_type) {12362 @field(result, field_name) = switch (field_type) {
12075 u32 => value,12363 u32 => value,
12076 String, Type, Constant, Function.Index, Function.Block.Index => @fromBackingInt(@intCast(value)),12364 String, Type, Constant, Function.Index, Function.Block.Index => @fromBackingInt(value),
12077 Constant.GetElementPtr.Info => @bitCast(value),12365 Constant.GetElementPtr.Info => @bitCast(value),
12078 else => @compileError("bad field type: " ++ @typeName(field_type)),12366 else => @compileError("bad field type: " ++ @typeName(field_type)),
12079 };12367 };
...@@ -12151,7 +12439,7 @@ fn metadataExtraDataTrail(...@@ -12151,7 +12439,7 @@ fn metadataExtraDataTrail(
12151 ) |field_name, field_type, value|12439 ) |field_name, field_type, value|
12152 @field(result, field_name) = switch (field_type) {12440 @field(result, field_name) = switch (field_type) {
12153 u32 => value,12441 u32 => value,
12154 Metadata.String, Metadata.String.Optional, Variable.Index, Value => @fromBackingInt(@intCast(value)),12442 Metadata.String, Metadata.String.Optional, Variable.Index, Value => @fromBackingInt(value),
12155 Metadata, Metadata.Optional, Metadata.DIFlags => @bitCast(value),12443 Metadata, Metadata.Optional, Metadata.DIFlags => @bitCast(value),
12156 else => @compileError("bad field type: " ++ @typeName(field_type)),12444 else => @compileError("bad field type: " ++ @typeName(field_type)),
12157 };12445 };
...@@ -12759,8 +13047,8 @@ fn debugSubprogramAssumeCapacity(...@@ -12759,8 +13047,8 @@ fn debugSubprogramAssumeCapacity(
12759 compile_unit: ?Metadata,13047 compile_unit: ?Metadata,
12760) Metadata {13048) Metadata {
12761 assert(!self.strip);13049 assert(!self.strip);
12762 const tag: Metadata.Tag = @fromBackingInt(@intCast(@backingInt(Metadata.Tag.subprogram) +13050 const tag: Metadata.Tag = @fromBackingInt(@backingInt(Metadata.Tag.subprogram) +
12763 @as(u3, @truncate(@as(u32, @bitCast(options.sp_flags)) >> 2))));13051 @as(u3, @truncate(@as(u32, @bitCast(options.sp_flags)) >> 2)));
12764 return self.metadataDistinctAssumeCapacity(tag, Metadata.Subprogram{13052 return self.metadataDistinctAssumeCapacity(tag, Metadata.Subprogram{
12765 .file = .wrap(file),13053 .file = .wrap(file),
12766 .name = .wrap(name),13054 .name = .wrap(name),
...@@ -13345,7 +13633,7 @@ fn metadataConstantAssumeCapacity(self: *Builder, constant: Constant) Metadata {...@@ -13345,7 +13633,7 @@ fn metadataConstantAssumeCapacity(self: *Builder, constant: Constant) Metadata {
1334513633
13346 pub fn eql(ctx: @This(), lhs_key: Constant, _: void, rhs_index: usize) bool {13634 pub fn eql(ctx: @This(), lhs_key: Constant, _: void, rhs_index: usize) bool {
13347 if (Metadata.Tag.constant != ctx.builder.metadata_items.items(.tag)[rhs_index]) return false;13635 if (Metadata.Tag.constant != ctx.builder.metadata_items.items(.tag)[rhs_index]) return false;
13348 const rhs_data: Constant = @fromBackingInt(@intCast(ctx.builder.metadata_items.items(.data)[rhs_index]));13636 const rhs_data: Constant = @fromBackingInt(ctx.builder.metadata_items.items(.data)[rhs_index]);
13349 return rhs_data == lhs_key;13637 return rhs_data == lhs_key;
13350 }13638 }
13351 };13639 };
...@@ -13577,6 +13865,7 @@ pub fn toBitcode(self: *Builder, allocator: Allocator, producer: Producer) bitco...@@ -13577,6 +13865,7 @@ pub fn toBitcode(self: *Builder, allocator: Allocator, producer: Producer) bitco
13577 switch (attr_index.toAttribute(self)) {13865 switch (attr_index.toAttribute(self)) {
13578 .zeroext,13866 .zeroext,
13579 .signext,13867 .signext,
13868 .noext,
13580 .inreg,13869 .inreg,
13581 .@"noalias",13870 .@"noalias",
13582 .nocapture,13871 .nocapture,
...@@ -13594,11 +13883,13 @@ pub fn toBitcode(self: *Builder, allocator: Allocator, producer: Producer) bitco...@@ -13594,11 +13883,13 @@ pub fn toBitcode(self: *Builder, allocator: Allocator, producer: Producer) bitco
13594 .readnone,13883 .readnone,
13595 .readonly,13884 .readonly,
13596 .writeonly,13885 .writeonly,
13886 .writable,
13887 .dead_on_unwind,
13597 .alwaysinline,13888 .alwaysinline,
13598 .builtin,13889 .builtin,
13599 .cold,13890 .cold,
13600 .convergent,13891 .convergent,
13601 .disable_sanitizer_information,13892 .disable_sanitizer_instrumentation,
13602 .fn_ret_thunk_extern,13893 .fn_ret_thunk_extern,
13603 .hot,13894 .hot,
13604 .inlinehint,13895 .inlinehint,
...@@ -13607,6 +13898,7 @@ pub fn toBitcode(self: *Builder, allocator: Allocator, producer: Producer) bitco...@@ -13607,6 +13898,7 @@ pub fn toBitcode(self: *Builder, allocator: Allocator, producer: Producer) bitco
13607 .naked,13898 .naked,
13608 .nobuiltin,13899 .nobuiltin,
13609 .nocallback,13900 .nocallback,
13901 .nodivergencesource,
13610 .noduplicate,13902 .noduplicate,
13611 .noimplicitfloat,13903 .noimplicitfloat,
13612 .@"noinline",13904 .@"noinline",
...@@ -13623,6 +13915,7 @@ pub fn toBitcode(self: *Builder, allocator: Allocator, producer: Producer) bitco...@@ -13623,6 +13915,7 @@ pub fn toBitcode(self: *Builder, allocator: Allocator, producer: Producer) bitco
13623 .nosanitize_bounds,13915 .nosanitize_bounds,
13624 .nosanitize_coverage,13916 .nosanitize_coverage,
13625 .null_pointer_is_valid,13917 .null_pointer_is_valid,
13918 .optdebug,
13626 .optforfuzzing,13919 .optforfuzzing,
13627 .optnone,13920 .optnone,
13628 .optsize,13921 .optsize,
...@@ -13633,18 +13926,21 @@ pub fn toBitcode(self: *Builder, allocator: Allocator, producer: Producer) bitco...@@ -13633,18 +13926,21 @@ pub fn toBitcode(self: *Builder, allocator: Allocator, producer: Producer) bitco
13633 .sanitize_thread,13926 .sanitize_thread,
13634 .sanitize_hwaddress,13927 .sanitize_hwaddress,
13635 .sanitize_memtag,13928 .sanitize_memtag,
13929 .sanitize_realtime,
13930 .sanitize_realtime_blocking,
13931 .sanitize_alloc_token,
13636 .speculative_load_hardening,13932 .speculative_load_hardening,
13637 .speculatable,13933 .speculatable,
13638 .ssp,13934 .ssp,
13639 .sspstrong,13935 .sspstrong,
13640 .sspreq,13936 .sspreq,
13641 .strictfp,13937 .strictfp,
13938 .denormal_fpenv,
13642 .nocf_check,13939 .nocf_check,
13643 .shadowcallstack,13940 .shadowcallstack,
13644 .mustprogress,13941 .mustprogress,
13645 .no_sanitize_address,13942 .nooutline,
13646 .no_sanitize_hwaddress,13943 .nocreateundeforpoison,
13647 .sanitize_address_dyninit,
13648 => {13944 => {
13649 try record.ensureUnusedCapacity(self.gpa, 2);13945 try record.ensureUnusedCapacity(self.gpa, 2);
13650 record.appendAssumeCapacity(0);13946 record.appendAssumeCapacity(0);
...@@ -13670,6 +13966,12 @@ pub fn toBitcode(self: *Builder, allocator: Allocator, producer: Producer) bitco...@@ -13670,6 +13966,12 @@ pub fn toBitcode(self: *Builder, allocator: Allocator, producer: Producer) bitco
13670 record.appendAssumeCapacity(@backingInt(kind));13966 record.appendAssumeCapacity(@backingInt(kind));
13671 record.appendAssumeCapacity(alignment.resolve(self).toByteUnits() orelse 0);13967 record.appendAssumeCapacity(alignment.resolve(self).toByteUnits() orelse 0);
13672 },13968 },
13969 .captures => |captures| {
13970 try record.ensureUnusedCapacity(self.gpa, 3);
13971 record.appendAssumeCapacity(1);
13972 record.appendAssumeCapacity(@backingInt(kind));
13973 record.appendAssumeCapacity(@as(u32, @bitCast(captures)));
13974 },
13673 .dereferenceable,13975 .dereferenceable,
13674 .dereferenceable_or_null,13976 .dereferenceable_or_null,
13675 => |size| {13977 => |size| {
...@@ -13684,6 +13986,9 @@ pub fn toBitcode(self: *Builder, allocator: Allocator, producer: Producer) bitco...@@ -13684,6 +13986,9 @@ pub fn toBitcode(self: *Builder, allocator: Allocator, producer: Producer) bitco
13684 record.appendAssumeCapacity(@backingInt(kind));13986 record.appendAssumeCapacity(@backingInt(kind));
13685 record.appendAssumeCapacity(@as(u32, @bitCast(fpclass)));13987 record.appendAssumeCapacity(@as(u32, @bitCast(fpclass)));
13686 },13988 },
13989 .initializes => @panic("TODO"),
13990 .dead_on_return => @panic("TODO"),
13991 .range => @panic("TODO"),
13687 .allockind => |allockind| {13992 .allockind => |allockind| {
13688 try record.ensureUnusedCapacity(self.gpa, 3);13993 try record.ensureUnusedCapacity(self.gpa, 3);
13689 record.appendAssumeCapacity(1);13994 record.appendAssumeCapacity(1);
...@@ -14099,7 +14404,7 @@ pub fn toBitcode(self: *Builder, allocator: Allocator, producer: Producer) bitco...@@ -14099,7 +14404,7 @@ pub fn toBitcode(self: *Builder, allocator: Allocator, producer: Producer) bitco
14099 }14404 }
14100 },14405 },
14101 .string => {14406 .string => {
14102 const str: String = @fromBackingInt(@intCast(data));14407 const str: String = @fromBackingInt(data);
14103 if (str == .none) {14408 if (str == .none) {
14104 try constants_block.writeAbbrev(ConstantsBlock.Null{});14409 try constants_block.writeAbbrev(ConstantsBlock.Null{});
14105 } else {14410 } else {
...@@ -14226,7 +14531,7 @@ pub fn toBitcode(self: *Builder, allocator: Allocator, producer: Producer) bitco...@@ -14226,7 +14531,7 @@ pub fn toBitcode(self: *Builder, allocator: Allocator, producer: Producer) bitco
14226 .dso_local_equivalent,14531 .dso_local_equivalent,
14227 .no_cfi,14532 .no_cfi,
14228 => |tag| {14533 => |tag| {
14229 const function: Function.Index = @fromBackingInt(@intCast(data));14534 const function: Function.Index = @fromBackingInt(data);
14230 try constants_block.writeAbbrev(ConstantsBlock.DsoLocalEquivalentOrNoCfi{14535 try constants_block.writeAbbrev(ConstantsBlock.DsoLocalEquivalentOrNoCfi{
14231 .code = switch (tag) {14536 .code = switch (tag) {
14232 .dso_local_equivalent => .DSO_LOCAL_EQUIVALENT,14537 .dso_local_equivalent => .DSO_LOCAL_EQUIVALENT,
...@@ -14609,7 +14914,7 @@ pub fn toBitcode(self: *Builder, allocator: Allocator, producer: Producer) bitco...@@ -14609,7 +14914,7 @@ pub fn toBitcode(self: *Builder, allocator: Allocator, producer: Producer) bitco
14609 }, metadata_adapter);14914 }, metadata_adapter);
14610 },14915 },
14611 .constant => {14916 .constant => {
14612 const constant: Constant = @fromBackingInt(@intCast(data));14917 const constant: Constant = @fromBackingInt(data);
14613 try metadata_block.writeAbbrevAdapted(MetadataBlock.Constant{14918 try metadata_block.writeAbbrevAdapted(MetadataBlock.Constant{
14614 .ty = constant.typeOf(self),14919 .ty = constant.typeOf(self),
14615 .constant = constant,14920 .constant = constant,
...@@ -14778,7 +15083,7 @@ pub fn toBitcode(self: *Builder, allocator: Allocator, producer: Producer) bitco...@@ -14778,7 +15083,7 @@ pub fn toBitcode(self: *Builder, allocator: Allocator, producer: Producer) bitco
14778 var adapter: FunctionAdapter = .{15083 var adapter: FunctionAdapter = .{
14779 .metadata_adapter = metadata_adapter,15084 .metadata_adapter = metadata_adapter,
14780 .func = &func,15085 .func = &func,
14781 .instruction_index = @fromBackingInt(@intCast(0)),15086 .instruction_index = @fromBackingInt(0),
14782 };15087 };
1478315088
14784 // Emit function level metadata block15089 // Emit function level metadata block
...@@ -14789,7 +15094,7 @@ pub fn toBitcode(self: *Builder, allocator: Allocator, producer: Producer) bitco...@@ -14789,7 +15094,7 @@ pub fn toBitcode(self: *Builder, allocator: Allocator, producer: Producer) bitco
14789 for (func.debug_values) |value| {15094 for (func.debug_values) |value| {
14790 try metadata_block.writeAbbrev(MetadataBlock.Value{15095 try metadata_block.writeAbbrev(MetadataBlock.Value{
14791 .ty = value.typeOf(@fromBackingInt(@intCast(func_index)), self),15096 .ty = value.typeOf(@fromBackingInt(@intCast(func_index)), self),
14792 .value = @fromBackingInt(@intCast(adapter.getValueIndex(value.toValue()))),15097 .value = @fromBackingInt(adapter.getValueIndex(value.toValue())),
14793 });15098 });
14794 }15099 }
1479515100
...@@ -15071,10 +15376,10 @@ pub fn toBitcode(self: *Builder, allocator: Allocator, producer: Producer) bitco...@@ -15071,10 +15376,10 @@ pub fn toBitcode(self: *Builder, allocator: Allocator, producer: Producer) bitco
15071 });15376 });
15072 },15377 },
15073 .fneg => try function_block.writeAbbrev(FunctionBlock.FNeg{15378 .fneg => try function_block.writeAbbrev(FunctionBlock.FNeg{
15074 .val = adapter.getOffsetValueIndex(@fromBackingInt(@intCast(data))),15379 .val = adapter.getOffsetValueIndex(@fromBackingInt(data)),
15075 }),15380 }),
15076 .@"fneg fast" => try function_block.writeAbbrev(FunctionBlock.FNegFast{15381 .@"fneg fast" => try function_block.writeAbbrev(FunctionBlock.FNegFast{
15077 .val = adapter.getOffsetValueIndex(@fromBackingInt(@intCast(data))),15382 .val = adapter.getOffsetValueIndex(@fromBackingInt(data)),
15078 .fast_math = FastMath.fast,15383 .fast_math = FastMath.fast,
15079 }),15384 }),
15080 .extractvalue => {15385 .extractvalue => {
...@@ -15274,7 +15579,7 @@ pub fn toBitcode(self: *Builder, allocator: Allocator, producer: Producer) bitco...@@ -15274,7 +15579,7 @@ pub fn toBitcode(self: *Builder, allocator: Allocator, producer: Producer) bitco
15274 try function_block.writeUnabbrev(16, record.items);15579 try function_block.writeUnabbrev(16, record.items);
15275 },15580 },
15276 .ret => try function_block.writeAbbrev(FunctionBlock.Ret{15581 .ret => try function_block.writeAbbrev(FunctionBlock.Ret{
15277 .val = adapter.getOffsetValueIndex(@fromBackingInt(@intCast(data))),15582 .val = adapter.getOffsetValueIndex(@fromBackingInt(data)),
15278 }),15583 }),
15279 .@"ret void" => try function_block.writeAbbrev(FunctionBlock.RetVoid{}),15584 .@"ret void" => try function_block.writeAbbrev(FunctionBlock.RetVoid{}),
15280 .atomicrmw => {15585 .atomicrmw => {