Commit 42356fb7 by Jim Stichnoth

Subzero: Add "szbuild.py --no-sz" arg for suppressing the pnacl-sz run.

This enables the following workflow: 1. Run "szbuild.py --filetype=asm ..." to generate a .s file. 2. Edit the .s file to mock up a Subzero change. 3. Run "szbuild.py --filetype=asm --no-sz ..." to restart the build post pnacl-sz. This workflow is good for trying out localized changes to hot basic blocks, though it isn't really appropriate for global optimizations like register allocation. BUG= none R=kschimpf@google.com Review URL: https://codereview.chromium.org/1417003005 .
parent af5d44c6
...@@ -98,6 +98,8 @@ def AddOptionalArgs(argparser): ...@@ -98,6 +98,8 @@ def AddOptionalArgs(argparser):
help='Extra arguments for Subzero') help='Extra arguments for Subzero')
argparser.add_argument('--llc', dest='llc_args', action='append', argparser.add_argument('--llc', dest='llc_args', action='append',
default=[], help='Extra arguments for llc') default=[], help='Extra arguments for llc')
argparser.add_argument('--no-sz', dest='nosz', action='store_true',
help='Run only post-Subzero build steps')
def main(): def main():
"""Create a hybrid translation from Subzero and llc. """Create a hybrid translation from Subzero and llc.
...@@ -216,22 +218,24 @@ def ProcessPexe(args, pexe, exe): ...@@ -216,22 +218,24 @@ def ProcessPexe(args, pexe, exe):
if (args.force or if (args.force or
NewerThanOrNotThere(pexe, obj_sz) or NewerThanOrNotThere(pexe, obj_sz) or
NewerThanOrNotThere(pnacl_sz, obj_sz)): NewerThanOrNotThere(pnacl_sz, obj_sz)):
# Run pnacl-sz regardless of hybrid mode. if not args.nosz:
shellcmd([pnacl_sz, # Run pnacl-sz regardless of hybrid mode.
'-O' + opt_level, shellcmd([pnacl_sz,
'-bitcode-format=pnacl', '-O' + opt_level,
'-filetype=' + args.filetype, '-bitcode-format=pnacl',
'-o', obj_sz if args.filetype == 'obj' else asm_sz, '-filetype=' + args.filetype,
'-target=' + args.target] + '-o', obj_sz if args.filetype == 'obj' else asm_sz,
(['-externalize', '-target=' + args.target] +
'-ffunction-sections', (['-externalize',
'-fdata-sections'] if hybrid else []) + '-ffunction-sections',
(['-sandbox'] if args.sandbox else []) + '-fdata-sections'] if hybrid else []) +
(['-enable-block-profile'] if (['-sandbox'] if args.sandbox else []) +
args.enable_block_profile and not args.sandbox else []) + (['-enable-block-profile'] if
args.sz_args + args.enable_block_profile and not args.sandbox
[pexe], else []) +
echo=args.verbose) args.sz_args +
[pexe],
echo=args.verbose)
if args.filetype != 'obj': if args.filetype != 'obj':
triple = { triple = {
'arm32': 'arm-nacl' if args.sandbox else 'arm', 'arm32': 'arm-nacl' if args.sandbox else 'arm',
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment