Changeset 254080 in webkit
- Timestamp:
- Jan 6, 2020, 12:58:44 PM (5 years ago)
- Location:
- trunk/Tools
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Tools/ChangeLog
r254064 r254080 1 2020-01-06 Mark Lam <mark.lam@apple.com> 2 3 Add --force-optimization-level option to Tools/Scripts/set-webkit-configuration. 4 https://bugs.webkit.org/show_bug.cgi?id=205787 5 6 Reviewed by Saam Barati. 7 8 Usage: 9 --force-optimization-level=<opt> Force optimization: O3, O2, O1, O0, Os, Ofast, Og, or none 10 11 This can be used to force debug builds to be built with a higher level optimization 12 so that tests can run to completion faster. 13 14 It can also be useful as a simple way to force release builds to be built with 15 different optimization levels for performance comparison. 16 17 Setting --force-optimization-level=none restores the default optimization levels. 18 Of course, the build targets need to be rebuilt for this to take effect. 19 20 * Scripts/set-webkit-configuration: 21 * Scripts/webkitdirs.pm: 22 (determineForceOptimizationLevel): 23 (forceOptimizationLevel): 24 (XcodeOptions): 25 1 26 2020-01-05 Dean Jackson <dino@apple.com> 2 27 -
trunk/Tools/Scripts/set-webkit-configuration
r235381 r254080 1 1 #!/usr/bin/env perl 2 2 3 # Copyright (C) 2005 Apple Inc. All rights reserved.3 # Copyright (C) 2005-2019 Apple Inc. All rights reserved. 4 4 # 5 5 # Redistribution and use in source and binary forms, with or without … … 36 36 my $usage = <<EOF; 37 37 Usage: $programName [options] 38 --32-bit Set the default architecture to 32-bit 39 --64-bit Set the default architecture to 64-bit 40 --[no-]asan Enable or disable clang address sanitizer 41 --lto-mode=<mode> Set LTO mode: full, thin, or none 42 --debug Set the default configuration to debug 43 --release Set the default configuration to release 44 --reset Reset configurations 38 --32-bit Set the default architecture to 32-bit 39 --64-bit Set the default architecture to 64-bit 40 --[no-]asan Enable or disable clang address sanitizer 41 --force-optimization-level=<level> Optimization level: O3, O2, O1, O0, Os, Ofast, Og, or none 42 --lto-mode=<mode> Set LTO mode: full, thin, or none 43 --debug Set the default configuration to debug 44 --release Set the default configuration to release 45 --reset Reset configurations 45 46 EOF 46 47 … … 52 53 if (!checkForArgumentAndRemoveFromARGVGettingValue("--lto-mode", \$ltoMode)) { 53 54 $ltoMode=""; 55 } 56 my $forceOptimizationLevel; 57 if (!checkForArgumentAndRemoveFromARGVGettingValue("--force-optimization-level", \$forceOptimizationLevel)) { 58 $forceOptimizationLevel=""; 54 59 } 55 60 … … 72 77 unlink "$baseProductDir/Architecture"; 73 78 unlink "$baseProductDir/ASan"; 79 unlink "$baseProductDir/ForceOptimizationLevel"; 74 80 unlink "$baseProductDir/LTO"; 75 81 exit 0; 76 82 } 77 83 78 if ((!$configuration && !$architecture && !$enableASAN && !$disableASAN && !$ltoMode ) || ($enableASAN && $disableASAN)) {84 if ((!$configuration && !$architecture && !$enableASAN && !$disableASAN && !$ltoMode && !$forceOptimizationLevel) || ($enableASAN && $disableASAN)) { 79 85 print STDERR $usage; 80 86 exit 1; … … 82 88 83 89 if ($ltoMode && $ltoMode ne "full" && $ltoMode ne "thin" && $ltoMode ne "none") { 90 print STDERR $usage; 91 exit 1; 92 } 93 94 if ($forceOptimizationLevel 95 && $forceOptimizationLevel ne "none" 96 && $forceOptimizationLevel ne "O0" 97 && $forceOptimizationLevel ne "O1" 98 && $forceOptimizationLevel ne "O2" 99 && $forceOptimizationLevel ne "O3" 100 && $forceOptimizationLevel ne "Os" 101 && $forceOptimizationLevel ne "Ofast" 102 && $forceOptimizationLevel ne "Og") { 84 103 print STDERR $usage; 85 104 exit 1; … … 110 129 } 111 130 131 if ($forceOptimizationLevel && $forceOptimizationLevel eq "none") { 132 unlink "$baseProductDir/ForceOptimizationLevel"; 133 } elsif ($forceOptimizationLevel) { 134 open ForceOptimizationLevel, ">", "$baseProductDir/ForceOptimizationLevel" or die; 135 print ForceOptimizationLevel substr($forceOptimizationLevel, 1) . "\n"; 136 close ForceOptimizationLevel; 137 } 138 112 139 if ($ltoMode) { 113 140 open LTO, ">", "$baseProductDir/LTO" or die; -
trunk/Tools/Scripts/webkitdirs.pm
r253845 r254080 1 # Copyright (C) 2005-20 07, 2010-2016Apple Inc. All rights reserved.1 # Copyright (C) 2005-2019 Apple Inc. All rights reserved. 2 2 # Copyright (C) 2009 Google Inc. All rights reserved. 3 3 # Copyright (C) 2011 Research In Motion Limited. All rights reserved. … … 133 133 my $architecture; 134 134 my $asanIsEnabled; 135 my $forceOptimizationLevel; 135 136 my $ltoMode; 136 137 my $numberOfCPUs; … … 424 425 } 425 426 427 sub determineForceOptimizationLevel 428 { 429 return if defined $forceOptimizationLevel; 430 determineBaseProductDir(); 431 432 if (open ForceOptimizationLevel, "$baseProductDir/ForceOptimizationLevel") { 433 $forceOptimizationLevel = <ForceOptimizationLevel>; 434 close ForceOptimizationLevel; 435 chomp $forceOptimizationLevel; 436 } 437 } 438 426 439 sub determineLTOMode 427 440 { … … 808 821 } 809 822 823 sub forceOptimizationLevel() 824 { 825 determineForceOptimizationLevel(); 826 return $forceOptimizationLevel; 827 } 828 810 829 sub ltoMode() 811 830 { … … 856 875 determineArchitecture(); 857 876 determineASanIsEnabled(); 877 determineForceOptimizationLevel(); 858 878 determineLTOMode(); 859 879 determineXcodeSDK(); … … 864 884 push @options, ("-configuration", $configuration); 865 885 push @options, ("-xcconfig", sourceDir() . "/Tools/asan/asan.xcconfig", "ASAN_IGNORE=" . sourceDir() . "/Tools/asan/webkit-asan-ignore.txt") if $asanIsEnabled; 886 push @options, ("GCC_OPTIMIZATION_LEVEL=$forceOptimizationLevel") if $forceOptimizationLevel; 866 887 push @options, "WK_LTO_MODE=$ltoMode" if $ltoMode; 867 888 push @options, @baseProductDirOption;
Note:
See TracChangeset
for help on using the changeset viewer.