1010
1111#include < algorithm>
1212
13- LUAU_FASTFLAGVARIABLE (LuauCodeGenBetterBytecodeAnalysis)
14-
1513namespace Luau
1614{
1715namespace CodeGen
@@ -774,26 +772,16 @@ void analyzeBytecodeTypes(IrFunction& function, const HostIrHooks& hostHooks)
774772 }
775773 case LOP_GETTABLE:
776774 {
777- if (FFlag::LuauCodeGenBetterBytecodeAnalysis)
778- {
779- int ra = LUAU_INSN_A (*pc);
780- int rb = LUAU_INSN_B (*pc);
781- int rc = LUAU_INSN_C (*pc);
775+ int ra = LUAU_INSN_A (*pc);
776+ int rb = LUAU_INSN_B (*pc);
777+ int rc = LUAU_INSN_C (*pc);
782778
783- regTags[ra] = LBC_TYPE_ANY;
779+ regTags[ra] = LBC_TYPE_ANY;
784780
785- bcType.a = regTags[rb];
786- bcType.b = regTags[rc];
781+ bcType.a = regTags[rb];
782+ bcType.b = regTags[rc];
787783
788- bcType.result = regTags[ra];
789- }
790- else
791- {
792- int rb = LUAU_INSN_B (*pc);
793- int rc = LUAU_INSN_C (*pc);
794- bcType.a = regTags[rb];
795- bcType.b = regTags[rc];
796- }
784+ bcType.result = regTags[ra];
797785 break ;
798786 }
799787 case LOP_SETTABLE:
@@ -851,25 +839,15 @@ void analyzeBytecodeTypes(IrFunction& function, const HostIrHooks& hostHooks)
851839 }
852840 case LOP_GETTABLEN:
853841 {
854- if (FFlag::LuauCodeGenBetterBytecodeAnalysis)
855- {
856- int ra = LUAU_INSN_A (*pc);
857- int rb = LUAU_INSN_B (*pc);
842+ int ra = LUAU_INSN_A (*pc);
843+ int rb = LUAU_INSN_B (*pc);
858844
859- regTags[ra] = LBC_TYPE_ANY;
845+ regTags[ra] = LBC_TYPE_ANY;
860846
861- bcType.a = regTags[rb];
862- bcType.b = LBC_TYPE_NUMBER;
847+ bcType.a = regTags[rb];
848+ bcType.b = LBC_TYPE_NUMBER;
863849
864- bcType.result = regTags[ra];
865- }
866- else
867- {
868- int rb = LUAU_INSN_B (*pc);
869- bcType.a = regTags[rb];
870- bcType.b = LBC_TYPE_NUMBER;
871- break ;
872- }
850+ bcType.result = regTags[ra];
873851 break ;
874852 }
875853 case LOP_SETTABLEN:
@@ -1157,11 +1135,8 @@ void analyzeBytecodeTypes(IrFunction& function, const HostIrHooks& hostHooks)
11571135
11581136 refineRegType (bcTypeInfo, ra, i, bcType.result );
11591137
1160- if (FFlag::LuauCodeGenBetterBytecodeAnalysis)
1161- {
1162- // Fastcall failure fallback is skipped from result propagation
1163- i += skip;
1164- }
1138+ // Fastcall failure fallback is skipped from result propagation
1139+ i += skip;
11651140 break ;
11661141 }
11671142 case LOP_FASTCALL1:
@@ -1181,11 +1156,8 @@ void analyzeBytecodeTypes(IrFunction& function, const HostIrHooks& hostHooks)
11811156
11821157 refineRegType (bcTypeInfo, ra, i, bcType.result );
11831158
1184- if (FFlag::LuauCodeGenBetterBytecodeAnalysis)
1185- {
1186- // Fastcall failure fallback is skipped from result propagation
1187- i += skip;
1188- }
1159+ // Fastcall failure fallback is skipped from result propagation
1160+ i += skip;
11891161 break ;
11901162 }
11911163 case LOP_FASTCALL2:
@@ -1205,11 +1177,8 @@ void analyzeBytecodeTypes(IrFunction& function, const HostIrHooks& hostHooks)
12051177
12061178 refineRegType (bcTypeInfo, ra, i, bcType.result );
12071179
1208- if (FFlag::LuauCodeGenBetterBytecodeAnalysis)
1209- {
1210- // Fastcall failure fallback is skipped from result propagation
1211- i += skip;
1212- }
1180+ // Fastcall failure fallback is skipped from result propagation
1181+ i += skip;
12131182 break ;
12141183 }
12151184 case LOP_FASTCALL3:
@@ -1231,11 +1200,8 @@ void analyzeBytecodeTypes(IrFunction& function, const HostIrHooks& hostHooks)
12311200
12321201 refineRegType (bcTypeInfo, ra, i, bcType.result );
12331202
1234- if (FFlag::LuauCodeGenBetterBytecodeAnalysis)
1235- {
1236- // Fastcall failure fallback is skipped from result propagation
1237- i += skip;
1238- }
1203+ // Fastcall failure fallback is skipped from result propagation
1204+ i += skip;
12391205 break ;
12401206 }
12411207 case LOP_FORNPREP:
@@ -1347,13 +1313,10 @@ void analyzeBytecodeTypes(IrFunction& function, const HostIrHooks& hostHooks)
13471313 }
13481314 case LOP_GETGLOBAL:
13491315 {
1350- if (FFlag::LuauCodeGenBetterBytecodeAnalysis)
1351- {
1352- int ra = LUAU_INSN_A (*pc);
1316+ int ra = LUAU_INSN_A (*pc);
13531317
1354- regTags[ra] = LBC_TYPE_ANY;
1355- bcType.result = regTags[ra];
1356- }
1318+ regTags[ra] = LBC_TYPE_ANY;
1319+ bcType.result = regTags[ra];
13571320 break ;
13581321 }
13591322 case LOP_SETGLOBAL:
@@ -1382,48 +1345,39 @@ void analyzeBytecodeTypes(IrFunction& function, const HostIrHooks& hostHooks)
13821345 case LOP_AND:
13831346 case LOP_OR:
13841347 {
1385- if (FFlag::LuauCodeGenBetterBytecodeAnalysis)
1386- {
1387- int ra = LUAU_INSN_A (*pc);
1388- int rb = LUAU_INSN_B (*pc);
1389- int rc = LUAU_INSN_C (*pc);
1348+ int ra = LUAU_INSN_A (*pc);
1349+ int rb = LUAU_INSN_B (*pc);
1350+ int rc = LUAU_INSN_C (*pc);
13901351
1391- bcType.a = regTags[rb];
1392- bcType.b = regTags[rc];
1352+ bcType.a = regTags[rb];
1353+ bcType.b = regTags[rc];
13931354
1394- regTags[ra] = LBC_TYPE_ANY;
1395- bcType.result = regTags[ra];
1396- }
1355+ regTags[ra] = LBC_TYPE_ANY;
1356+ bcType.result = regTags[ra];
13971357 break ;
13981358 }
13991359 case LOP_ANDK:
14001360 case LOP_ORK:
14011361 {
1402- if (FFlag::LuauCodeGenBetterBytecodeAnalysis)
1403- {
1404- int ra = LUAU_INSN_A (*pc);
1405- int rb = LUAU_INSN_B (*pc);
1406- int kc = LUAU_INSN_C (*pc);
1362+ int ra = LUAU_INSN_A (*pc);
1363+ int rb = LUAU_INSN_B (*pc);
1364+ int kc = LUAU_INSN_C (*pc);
14071365
1408- bcType.a = regTags[rb];
1409- bcType.b = getBytecodeConstantTag (proto, kc);
1366+ bcType.a = regTags[rb];
1367+ bcType.b = getBytecodeConstantTag (proto, kc);
14101368
1411- regTags[ra] = LBC_TYPE_ANY;
1412- bcType.result = regTags[ra];
1413- }
1369+ regTags[ra] = LBC_TYPE_ANY;
1370+ bcType.result = regTags[ra];
14141371 break ;
14151372 }
14161373 case LOP_COVERAGE:
14171374 break ;
14181375 case LOP_GETIMPORT:
14191376 {
1420- if (FFlag::LuauCodeGenBetterBytecodeAnalysis)
1421- {
1422- int ra = LUAU_INSN_A (*pc);
1377+ int ra = LUAU_INSN_A (*pc);
14231378
1424- regTags[ra] = LBC_TYPE_ANY;
1425- bcType.result = regTags[ra];
1426- }
1379+ regTags[ra] = LBC_TYPE_ANY;
1380+ bcType.result = regTags[ra];
14271381 break ;
14281382 }
14291383 case LOP_CAPTURE:
0 commit comments