870870 # Set ASM_JS default here so that we can override it from the command line.
871871 shared .Settings .ASM_JS = 1 if opt_level > 0 else 2
872872
873- pre_fastcomp_opts = []
874-
875873 # Apply -s settings in newargs here (after optimization levels, so they can override them)
876874 for change in settings_changes :
877875 key , value = change .split ('=' )
@@ -902,20 +900,6 @@ try:
902900 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' )
903901 raise e
904902
905- fastcomp_opts = []
906- if shared .Settings .NO_EXIT_RUNTIME :
907- pre_fastcomp_opts += ['-emscripten-no-exit-runtime' ]
908- if not llvm_lto : fastcomp_opts += ['-globalopt' , '-globaldce' ]
909- fastcomp_opts += ['-pnacl-abi-simplify-preopt' , '-pnacl-abi-simplify-postopt' ]
910- if shared .Settings .DISABLE_EXCEPTION_CATCHING != 1 :
911- fastcomp_opts += ['-enable-emscripten-cxx-exceptions' ]
912- if shared .Settings .DISABLE_EXCEPTION_CATCHING == 2 :
913- fastcomp_opts += ['-emscripten-cxx-exceptions-whitelist=' + ',' .join (shared .Settings .EXCEPTION_CATCHING_WHITELIST or ['fake' ])]
914- if shared .Settings .ASYNCIFY :
915- fastcomp_opts += ['-emscripten-asyncify' ]
916- fastcomp_opts += ['-emscripten-asyncify-functions=' + ',' .join (shared .Settings .ASYNCIFY_FUNCTIONS )]
917- fastcomp_opts += ['-emscripten-asyncify-whitelist=' + ',' .join (shared .Settings .ASYNCIFY_WHITELIST )]
918-
919903 assert not shared .Settings .PGO , 'cannot run PGO in ASM_JS mode'
920904
921905 if shared .Settings .SAFE_HEAP and not js_opts :
@@ -1278,7 +1262,7 @@ try:
12781262 if not shared .Settings .ASSERTIONS :
12791263 link_opts += ['-disable-verify' ]
12801264
1281- if llvm_lto >= 2 :
1265+ if llvm_lto >= 2 and llvm_opts > 0 :
12821266 logging .debug ('running LLVM opts as pre-LTO' )
12831267 final = shared .Building .llvm_opt (final , llvm_opts , DEFAULT_FINAL )
12841268 if DEBUG : save_intermediate ('opt' , 'bc' )
@@ -1289,9 +1273,8 @@ try:
12891273 # add a manual internalize with the proper things we need to be kept alive during lto
12901274 link_opts += shared .Building .get_safe_internalize () + ['-std-link-opts' ]
12911275 # execute it now, so it is done entirely before we get to the stage of legalization etc.
1292- final = shared .Building .llvm_opt (final , pre_fastcomp_opts + link_opts , DEFAULT_FINAL )
1276+ final = shared .Building .llvm_opt (final , link_opts , DEFAULT_FINAL )
12931277 if DEBUG : save_intermediate ('lto' , 'bc' )
1294- pre_fastcomp_opts = []
12951278 link_opts = []
12961279 else :
12971280 # At minimum remove dead functions etc., this potentially saves a lot in the size of the generated code (and the time to compile it)
@@ -1303,15 +1286,11 @@ try:
13031286 final = shared .Building .llvm_opt (final , link_opts , get_final () + '.link.ll' )
13041287 if DEBUG : save_intermediate ('linktime' , 'll' )
13051288 else :
1306- if not save_bc :
1307- # Simplify LLVM bitcode for fastcomp
1308- link_opts = pre_fastcomp_opts + link_opts + fastcomp_opts
1309- final = shared .Building .llvm_opt (final , link_opts , DEFAULT_FINAL )
1310- if DEBUG : save_intermediate ('linktime' , 'bc' )
1289+ if len (link_opts ) > 0 :
1290+ final = shared .Building .llvm_opt (final , link_opts , DEFAULT_FINAL )
1291+ if DEBUG : save_intermediate ('linktime' , 'bc' )
13111292 if save_bc :
13121293 shutil .copyfile (final , save_bc )
1313- final = shared .Building .llvm_opt (final , fastcomp_opts , get_final () + '.adsimp.bc' )
1314- if DEBUG : save_intermediate ('adsimp' , 'bc' )
13151294
13161295 # Prepare .ll for Emscripten
13171296 if LEAVE_INPUTS_RAW :
@@ -1325,11 +1304,6 @@ try:
13251304 final = next
13261305 if DEBUG : save_intermediate ('autodebug' , 'll' )
13271306
1328- # Simplify bitcode after autodebug
1329- if AUTODEBUG or LEAVE_INPUTS_RAW :
1330- final = shared .Building .llvm_opt (final , fastcomp_opts , get_final () + '.adsimp.bc' )
1331- if DEBUG : save_intermediate ('adsimp' , 'bc' )
1332-
13331307 assert type (final ) == str , 'we must have linked the final files, if linking was deferred, by this point'
13341308
13351309 log_time ('post-link' )
0 commit comments