Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(143)

Unified Diff: pnacl/driver/pnacl-ld.py

Issue 12843006: Use llvm-opt's LTO pass list instead of generic O2/O3 pass list for LTO (Closed) Base URL: svn://svn.chromium.org/native_client/trunk/src/native_client
Patch Set: rebase Created 7 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « pnacl/build.sh ('k') | tests/toolchain/nacl.scons » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pnacl/driver/pnacl-ld.py
diff --git a/pnacl/driver/pnacl-ld.py b/pnacl/driver/pnacl-ld.py
index 2dc197024eb00535a4a032710530fca3c4ad9991..7051ec0166b7d5c068db7781ac855ce3460c6bd1 100755
--- a/pnacl/driver/pnacl-ld.py
+++ b/pnacl/driver/pnacl-ld.py
@@ -40,7 +40,8 @@ EXTRA_ENV = {
'OPT_LEVEL': '', # Default opt is 0, but we need to know if it's explicitly
# requested or not, since we don't want to propagate
# the value to TRANSLATE_FLAGS if it wasn't explicitly set.
- 'OPT_FLAGS': '-O${#OPT_LEVEL ? ${OPT_LEVEL} : 0} ${OPT_STRIP_%STRIP_MODE%} ' +
+ 'OPT_LTO_FLAGS': '-std-link-opts -disable-internalize',
+ 'OPT_FLAGS': '${#OPT_LEVEL && !OPT_LEVEL == 0 ? ${OPT_LTO_FLAGS}} ${OPT_STRIP_%STRIP_MODE%} ' +
'-inline-threshold=${OPT_INLINE_THRESHOLD} ' +
'--do-not-wrap',
'OPT_STRIP_none': '',
@@ -349,7 +350,7 @@ def main(argv):
chain.add(DoLLVMPasses(passes), 'expand_features.' + bitcode_type)
if env.getone('OPT_LEVEL') != '' and env.getone('OPT_LEVEL') != '0':
- chain.add(DoOPT, 'opt.' + bitcode_type)
+ chain.add(DoLTO, 'opt.' + bitcode_type)
elif env.getone('STRIP_MODE') != 'none':
chain.add(DoStrip, 'stripped.' + bitcode_type)
@@ -459,10 +460,10 @@ def DoLLVMPasses(pass_list):
def Func(infile, outfile):
filtered_list = [pass_option for pass_option in pass_list
if pass_option not in env.get('LLVM_PASSES_TO_DISABLE')]
- RunDriver('opt', filtered_list + [infile, '-o', outfile])
+ RunDriver('opt', filtered_list + [infile, '-o', outfile, '--do-not-wrap'])
return Func
-def DoOPT(infile, outfile):
+def DoLTO(infile, outfile):
opt_flags = env.get('OPT_FLAGS')
RunDriver('opt', opt_flags + [ infile, '-o', outfile ])
« no previous file with comments | « pnacl/build.sh ('k') | tests/toolchain/nacl.scons » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698