873
873
# Set ASM_JS default here so that we can override it from the command line.
874
874
shared .Settings .ASM_JS = 1 if opt_level > 0 else 2
875
875
876
- pre_fastcomp_opts = []
877
-
878
876
# Apply -s settings in newargs here (after optimization levels, so they can override them)
879
877
for change in settings_changes :
880
878
key , value = change .split ('=' )
@@ -905,20 +903,6 @@ try:
905
903
logging .error ('Compiler settings are incompatible with fastcomp. You can fall back to the older compiler core, although that is not recommended, see http://kripken.github.io/emscripten-site/docs/building_from_source/LLVM-Backend.html' )
906
904
raise e
907
905
908
- fastcomp_opts = []
909
- if shared .Settings .NO_EXIT_RUNTIME :
910
- pre_fastcomp_opts += ['-emscripten-no-exit-runtime' ]
911
- if not llvm_lto : fastcomp_opts += ['-globalopt' , '-globaldce' ]
912
- fastcomp_opts += ['-pnacl-abi-simplify-preopt' , '-pnacl-abi-simplify-postopt' ]
913
- if shared .Settings .DISABLE_EXCEPTION_CATCHING != 1 :
914
- fastcomp_opts += ['-enable-emscripten-cxx-exceptions' ]
915
- if shared .Settings .DISABLE_EXCEPTION_CATCHING == 2 :
916
- fastcomp_opts += ['-emscripten-cxx-exceptions-whitelist=' + ',' .join (shared .Settings .EXCEPTION_CATCHING_WHITELIST or ['fake' ])]
917
- if shared .Settings .ASYNCIFY :
918
- fastcomp_opts += ['-emscripten-asyncify' ]
919
- fastcomp_opts += ['-emscripten-asyncify-functions=' + ',' .join (shared .Settings .ASYNCIFY_FUNCTIONS )]
920
- fastcomp_opts += ['-emscripten-asyncify-whitelist=' + ',' .join (shared .Settings .ASYNCIFY_WHITELIST )]
921
-
922
906
assert not shared .Settings .PGO , 'cannot run PGO in ASM_JS mode'
923
907
924
908
if shared .Settings .SAFE_HEAP and not js_opts :
@@ -1281,7 +1265,7 @@ try:
1281
1265
if not shared .Settings .ASSERTIONS :
1282
1266
link_opts += ['-disable-verify' ]
1283
1267
1284
- if llvm_lto >= 2 :
1268
+ if llvm_lto >= 2 and llvm_opts > 0 :
1285
1269
logging .debug ('running LLVM opts as pre-LTO' )
1286
1270
final = shared .Building .llvm_opt (final , llvm_opts , DEFAULT_FINAL )
1287
1271
if DEBUG : save_intermediate ('opt' , 'bc' )
@@ -1292,9 +1276,8 @@ try:
1292
1276
# add a manual internalize with the proper things we need to be kept alive during lto
1293
1277
link_opts += shared .Building .get_safe_internalize () + ['-std-link-opts' ]
1294
1278
# execute it now, so it is done entirely before we get to the stage of legalization etc.
1295
- final = shared .Building .llvm_opt (final , pre_fastcomp_opts + link_opts , DEFAULT_FINAL )
1279
+ final = shared .Building .llvm_opt (final , link_opts , DEFAULT_FINAL )
1296
1280
if DEBUG : save_intermediate ('lto' , 'bc' )
1297
- pre_fastcomp_opts = []
1298
1281
link_opts = []
1299
1282
else :
1300
1283
# At minimum remove dead functions etc., this potentially saves a lot in the size of the generated code (and the time to compile it)
@@ -1306,15 +1289,11 @@ try:
1306
1289
final = shared .Building .llvm_opt (final , link_opts , get_final () + '.link.ll' )
1307
1290
if DEBUG : save_intermediate ('linktime' , 'll' )
1308
1291
else :
1309
- if not save_bc :
1310
- # Simplify LLVM bitcode for fastcomp
1311
- link_opts = pre_fastcomp_opts + link_opts + fastcomp_opts
1312
- final = shared .Building .llvm_opt (final , link_opts , DEFAULT_FINAL )
1313
- if DEBUG : save_intermediate ('linktime' , 'bc' )
1292
+ if len (link_opts ) > 0 :
1293
+ final = shared .Building .llvm_opt (final , link_opts , DEFAULT_FINAL )
1294
+ if DEBUG : save_intermediate ('linktime' , 'bc' )
1314
1295
if save_bc :
1315
1296
shutil .copyfile (final , save_bc )
1316
- final = shared .Building .llvm_opt (final , fastcomp_opts , get_final () + '.adsimp.bc' )
1317
- if DEBUG : save_intermediate ('adsimp' , 'bc' )
1318
1297
1319
1298
# Prepare .ll for Emscripten
1320
1299
if LEAVE_INPUTS_RAW :
@@ -1328,11 +1307,6 @@ try:
1328
1307
final = next
1329
1308
if DEBUG : save_intermediate ('autodebug' , 'll' )
1330
1309
1331
- # Simplify bitcode after autodebug
1332
- if AUTODEBUG or LEAVE_INPUTS_RAW :
1333
- final = shared .Building .llvm_opt (final , fastcomp_opts , get_final () + '.adsimp.bc' )
1334
- if DEBUG : save_intermediate ('adsimp' , 'bc' )
1335
-
1336
1310
assert type (final ) == str , 'we must have linked the final files, if linking was deferred, by this point'
1337
1311
1338
1312
log_time ('post-link' )
0 commit comments