From: Jan Voung Date: Fri, 6 Jun 2014 15:47:54 +0000 (-0700) Subject: Make py import not assume dir is "pnacl-subzero". Avoid autovect in crosstest. X-Git-Tag: android-x86-7.1-r1~148^2~1202 X-Git-Url: http://git.osdn.net/view?a=commitdiff_plain;h=1248a6d1b2040d1178137006f8494b44d128a3c5;p=android-x86%2Fexternal-swiftshader.git Make py import not assume dir is "pnacl-subzero". Avoid autovect in crosstest. Derek's CL to check out subzero calls the source directory "subzero", and the file header comments call the directory "subzero". Just make the python sys.path munging for importing pydir more generic. Also change crosstest to not run the raw LLVM "opt" with optimizations (only use it for ABI stabilization passes). Instead run pnacl-clang with -O2. Otherwise, newer NACL_SDK versions include a newer LLVM "opt" binary which autovectorizes and may generate vector IR that is not handled by Subzero yet. E.g., LLVM ERROR: Invalid PNaCl instruction: %1 = insertelement <4 x i32> undef, i32 %0, i32 0 w/ pepper_canary to version 37, revision 274873 BUG=none TEST=make -f Makefile.standalone check R=stichnot@chromium.org, wala@chromium.org Review URL: https://codereview.chromium.org/317963002 --- diff --git a/llvm2iceinsts.py b/llvm2iceinsts.py index b04505fed..29ddd145f 100755 --- a/llvm2iceinsts.py +++ b/llvm2iceinsts.py @@ -7,10 +7,7 @@ import re import subprocess import sys -for p in sys.path: - if p.endswith('/toolchain_build/src/pnacl-subzero'): - sys.path.insert(0, p + '/pydir') - break +sys.path.insert(0, os.path.join(os.path.dirname(__file__), 'pydir')) from utils import shellcmd diff --git a/pydir/build-pnacl-ir.py b/pydir/build-pnacl-ir.py index 67dbefdbb..9395fc7f5 100755 --- a/pydir/build-pnacl-ir.py +++ b/pydir/build-pnacl-ir.py @@ -40,10 +40,10 @@ Please set the NACL_SDK_ROOT environment variable or pass the path through pnaclname = basename + '.pnacl.ll' pnaclname = os.path.join(args.dir, pnaclname) - shellcmd(clang_path + ' -I{0} -c {1} -o {2}'.format( + shellcmd(clang_path + ' -O2 -I{0} -c {1} -o {2}'.format( includes_path, cname, llname)) shellcmd(opt_path + - ' -O2 -pnacl-abi-simplify-preopt -pnacl-abi-simplify-postopt' + + ' -pnacl-abi-simplify-preopt -pnacl-abi-simplify-postopt' + ('' if args.disable_verify else ' -verify-pnaclabi-module -verify-pnaclabi-functions') + ' -pnaclabi-allow-debug-metadata -disable-simplify-libcalls'