- 23 Mar, 2015 1 commit
-
-
Jim Stichnoth authored
When lowering of a couple of atomic intrinsics down to a loop structure, a FakeUse on the memory address's base variable is created. However, if the memory address is a global constant, there is no base variable. So check for that and don't create a FakeUse if there is none. BUG= none TEST=synchronization_sync (scons test) R=jvoung@chromium.org Review URL: https://codereview.chromium.org/1023673007
-
- 20 Mar, 2015 3 commits
-
-
Jan Voung authored
Simplifies the GlobalContext constructor so that a future change may just set up the flags and the GlobalContext before calling into what is currently "main". Namely this change: https://codereview.chromium.org/997773002/ This also moves all uses of LLVM's CommandLine.h to a single file, so that in the future we may be able to simplify the flags parsing (especially for the minimal build). BUG= https://code.google.com/p/nativeclient/issues/detail?id=4091 BUG= https://code.google.com/p/nativeclient/issues/detail?id=4084 R=stichnot@chromium.org Review URL: https://codereview.chromium.org/1024203002
-
Jim Stichnoth authored
The pand instruction for masking off the sign bit can operate on a register or an m128 memory location, but not a 32-bit or 64-bit memory location. This means we need to make sure f32 and f64 operands are first loaded into a register. BUG= none R=jvoung@chromium.org Review URL: https://codereview.chromium.org/1022123004
-
Jim Stichnoth authored
This is done by emitting the following: .byte 0xe8 .long __Sz_AbsoluteZero -4 - . The linker is passed an argument like --defsym=__Sz_AbsoluteZero=0 to force the symbol's value to 0. This special symbol is needed due to an llvm-mc parsing bug. BUG= none R=jvoung@chromium.org Review URL: https://codereview.chromium.org/1027593002
-
- 19 Mar, 2015 3 commits
-
-
Jim Stichnoth authored
This fixes a regression likely introduced in d2cb4361 . The problem is that by using the default std::unordered_map comparison predicate std::equal_to, we get incorrect behavior when the key is float or double: 1. 0.0 and -0.0 appear equal, so they share a constant pool entry even though the bit patterns are different. This is a correctness bug. 2. Each instance of NaN gets a separate constant pool entry, because NaN != NaN by C equality rules. This is a performance bug. (This problem doesn't show up with the native bitcode reader, because constants are already unique-ified in the PNaCl bitcode file.) The solution is to use memcmp for floating-point key types. Also, the abi-atomics.ll test is disabled for the MINIMAL build, to fix an oversight from a previous CL. BUG= none R=jfb@chromium.org Review URL: https://codereview.chromium.org/1019233002
-
Jim Stichnoth authored
The intrinsic is lowered using the standard technique of masking off the FP sign bit, which is the high-order bit. To construct this mask, we use the existing trick of loading a vector register with all "1" bits, then logical-shift-right by one bit. In the future, we should add 128-bit vector values to the constant pool and force them to memory, and this could be used for the other routines that synthesize a vector constant. BUG= https://code.google.com/p/nativeclient/issues/detail?id=4097 R=jvoung@chromium.org Review URL: https://codereview.chromium.org/1022573004
-
Jan Voung authored
Finally address this TODO in the assembler. This will help translate non-IRT using programs (no ABI stability). The default scons testing mode is non-IRT, so this helps with that. I haven't actually tested this against scons yet, but I'm filling in the tests based on how LLVM translates the same bitcode. The filetype=asm is adjusted to omit the "*" and the "$". The filetype=obj is adjusted to check for fixups with NullSymbols, and also fill the assembler buffer at the instruction's immediate field w/ the right constant. The filetype=iasm is still TODO (hits an new assert in the Fixup's emit() function). Reverts 7ad1bed9: "Allow stubbing of called constant addresses using command line argument." since this is now handled (except for iasm). BUG= https://code.google.com/p/nativeclient/issues/detail?id=4080 R=stichnot@chromium.org Review URL: https://codereview.chromium.org/1017373002
-
- 18 Mar, 2015 2 commits
-
-
Jim Stichnoth authored
The actual code lowering is unchanged, but the validation is made less strict to allow the additional orderings. BUG= https://code.google.com/p/nativeclient/issues/detail?id=4029 R=jfb@chromium.org Review URL: https://codereview.chromium.org/1017453007
-
Jim Stichnoth authored
The attribute matching logic was wrong. If you specify the exact set of attributes, i.e. for a single test, no match would be found due to the < instead of <= test. BUG= none R=jvoung@chromium.org Review URL: https://codereview.chromium.org/1020473002
-
- 13 Mar, 2015 1 commit
-
-
Jim Stichnoth authored
This makes it more convenient to directly test the crosstests without having to go through the lit tests first. BUG= none R=kschimpf@google.com Review URL: https://codereview.chromium.org/1005163002
-
- 12 Mar, 2015 1 commit
-
-
Karl Schimpf authored
Fixes error reporting to match that of CL https://codereview.chromium.org/986453002 BUG=None R=stichnot@chromium.org Review URL: https://codereview.chromium.org/980393004
-
- 10 Mar, 2015 2 commits
-
-
Jim Stichnoth authored
This just puts the CMakeLists.txt file in place. A couple other changes are needed in other repos to make this take effect. BUG= none R=dschuff@chromium.org, mtrofin@chromium.org Review URL: https://codereview.chromium.org/998693003
-
Jim Stichnoth authored
The runtests.sh script is removed and replaced with crosstest_generator.py. "make check" limits to a relevant subset of cross tests to control the combinatorial explosion. We cut the native tests almost in half, and the sandboxed tests down to a quarter. The --include and --exclude logic is copied/adapted from szbuild.py. The script works by running through every possible test in the combinatorial explosion, and if the test is a match against the --include and --exclude arguments, the test is built and run. The script includes lit support, which is the most likely way it will be run. When run with the --lit argument, it sprays the output directory with lit test files in the form of shell scripts, and "make check" runs lit on that directory. BUG= https://code.google.com/p/nativeclient/issues/detail?id=4085 R=jvoung@chromium.org, mtrofin@chromium.org Review URL: https://codereview.chromium.org/987503004
-
- 06 Mar, 2015 1 commit
-
-
Jan Voung authored
This makes it compatible with the current browser interface, which pushes bytes to a DataStreamer. In the browser-integration mode, there will be a push-based DataStreamer (vs a file-based one). BUG= https://code.google.com/p/nativeclient/issues/detail?id=4091 R=dschuff@chromium.org, kschimpf@google.com, stichnot@chromium.org Review URL: https://codereview.chromium.org/982403002
-
- 05 Mar, 2015 1 commit
-
-
Jan Voung authored
Sometimes the work dir is empty and only cached results are used. I couldn't switch the LLVM one from work-dir to install/download-dir because we prune all the .a file in the download-dir. BUG=none R=kschimpf@google.com, stichnot@chromium.org Review URL: https://codereview.chromium.org/983533003
-
- 04 Mar, 2015 3 commits
-
-
Karl Schimpf authored
The error handling in LLVM for errors has been updated so that errors in the bitcode stream no longer cause (assertion crashes). This CL applies the appropriate changes to subzero. See CL https://codereview.chromium.org/932953002 for changes to error handling for LLVM. BUG= https://code.google.com/p/nativeclient/issues/detail?id=4002 R=stichnot@chromium.org Review URL: https://codereview.chromium.org/916313004
-
Jim Stichnoth authored
BUG= none R=jvoung@chromium.org Review URL: https://codereview.chromium.org/974113002
-
Jim Stichnoth authored
Tests all cross tests in both sandboxed and unsandboxed modes. Unfortunately, crosstest run time is more than doubled because of LTO of the crosstest drivers. (We may want to add "full" and "lite" versions of cross tests.) LLVM triple strings are removed where possible (from .ll files), and when generated, we use just i686 or i686-nacl. "Fix" the integrated assembler to emit the lock prefix after the 16-bit operand prefix, to make the validator happy. Don't add external symbol references to the ELF file for llvm.* intrinsic functions. Make the ELF object writer honor the -externalize argument. BUG= https://code.google.com/p/nativeclient/issues/detail?id=4092 R=jvoung@chromium.org Review URL: https://codereview.chromium.org/973823003
-
- 03 Mar, 2015 2 commits
-
-
Jan Voung authored
The default LLVM raw_fd_ostream buffer size is based on stat'ing the FD and then checking st_blksize. Unfortunately, in the NaCl sandboxed build of pnacl-sz, NaCl's syscall returns st_blksize of 0 which makes the writes unbuffered. There is a comment in "src/trusted/service_runtime/include/bits/stat.h": nacl_abi_blksize_t nacl_abi_st_blksize; /* not implemented */ And the " src/trusted/desc/" implementation sets this to 0. This results in half a million write syscalls to translate the GCC pexe, which roughly doubles the translation time in sandboxed mode vs unsandboxed mode. Manually set a buffer size (Linux st_blksize seems to be about 4KB for comparison). This drops the number of write syscalls to about 200 for translating the GCC pexe. BUG= https://code.google.com/p/nativeclient/issues/detail?id=4091 R=stichnot@chromium.org Review URL: https://codereview.chromium.org/969403003
-
Jim Stichnoth authored
When the advanced phi lowering handles a phi arg that is Undef, it lowers it to an assignment of a constant zero (or vector of zeroes). The ad-hoc register allocation was missing the fact that a vector of zeroes is done with "pxor %reg, %reg". This resulted in a pxor instruction with invalid addressing modes at emission time. The fix is to tell legalize() to use the dest physical register if dest has one; and if dest lacks a register, take the path where it actually does the ad-hoc register allocation as though the source operand were a memory operand. Tests are added for these vector undef phi args, and for scalar undef phi args as well for good measure. BUG= none R=jvoung@chromium.org Review URL: https://codereview.chromium.org/969703002
-
- 02 Mar, 2015 2 commits
-
-
Jan Voung authored
Need to list more dependencies, otherwise the static link fails. The current unsandboxed build is a shared build which uses libLLVM-3.*.so. Also mess with the CXXFlags a bit. The current pnacl-llc nexe build uses O3, but that triggers a method pointer bug: https://code.google.com/p/nativeclient/issues/detail?id=3857, so override that with O2. We may just want to change the pnacl-llc build as well (maybe use Os), but I don't know of the performance implications right now. Use gnu++11, because of newlib + libc++. Toggle the feature flags to be a MINIMAL build when building the sandboxed translator w/ the LLVM-based Makefile. Goes with build script change https://codereview.chromium.org/945473003/ BUG= https://code.google.com/p/nativeclient/issues/detail?id=4091 BUG= https://code.google.com/p/nativeclient/issues/detail?id=3857 R=dschuff@chromium.org, kschimpf@google.com Review URL: https://codereview.chromium.org/937283002
-
Jim Stichnoth authored
The runtime helpers are given more consistent names: __Sz_<bitcode>_<type1>_<type2> Missing helpers (various vector bitcasts) are implemented. We'd prefer to avoid calling external library functions, e.g. in compiler-rt, but even llc uses these helpers for some bitcode on x86-32, so the alternative is to copy their implementation into Subzero's runtime. BUG= none R=mtrofin@chromium.org Review URL: https://codereview.chromium.org/961413002
-
- 26 Feb, 2015 3 commits
-
-
Jan Voung authored
-
Jan Voung authored
-
Jim Stichnoth authored
Most of this is a mechanical change of 'llvm2ice' to 'pnacl-sz'. This is a convenient naming choice because both strings are the same length which minimizes the need for line length reformatting. Python variables needed to use pnacl_sz instead, and sometimes pnacl_sz_ . The IceConverter still uses LLVM2Ice naming, which is actually appropriate there since it actually converts LLVM IR into ICE. I will rename tests_lit/llvm2ice_tests/ in a separate CL, otherwise this CL will look misleadingly massive and no one will review it. BUG= none R=kschimpf@google.com Review URL: https://codereview.chromium.org/956123002
-
- 25 Feb, 2015 3 commits
-
-
Jim Stichnoth authored
1. Don't do anything in Cfg::emitTextHeader() in MINIMAL mode. (Reduces binary size by 1KB.) This actually broke a number of lit tests for the MINIMAL build, so "--assemble --disassemble" was changed to "--filetype=obj --disassemble". This allowed (or required) better precision in checking for data symbols. 1a. For the lit files touched, go ahead and remove "-verbose none" since that will forevermore by the default. 2. Don't emit the ".bundle_align_mode" directive. This is not necessary when assembling with the right -triple argument. BUG= none R=jvoung@chromium.org, kschimpf@google.com Review URL: https://codereview.chromium.org/955003002
-
Jan Voung authored
Rather than hard code 32. BUG= https://code.google.com/p/nativeclient/issues/detail?id=4080 R=stichnot@chromium.org Review URL: https://codereview.chromium.org/948343007
-
Jan Voung authored
Noticed the "Note: Still used by emit IAS" and decided to check if we can omit it. Saves about 3KB. There's also the "Note: Still used by emit IAS" CFG text header, but I haven't looked at that. This would silently cripple the -filetype=asm or -filetype=iasm in the MINIMAL build, but that isn't supposed to be supported. Had to conditionalize some more of the tests. BUG= https://code.google.com/p/nativeclient/issues/detail?id=4080 R=stichnot@chromium.org Review URL: https://codereview.chromium.org/952993006
-
- 24 Feb, 2015 4 commits
-
-
Jim Stichnoth authored
Delete zero-argument ctor where possible. Delete default copy ctor and default assignment operator where possible (some were missed in the past). (The above are not done to the cross tests because we aren't yet building them with C++11.) Declare single-argument ctor as "explicit". BUG= none R=jfb@chromium.org Review URL: https://codereview.chromium.org/952953002
-
Jim Stichnoth authored
BUG= none R=kschimpf@google.com Review URL: https://codereview.chromium.org/951283002
-
Jan Voung authored
Just create a new section of the appropriate name, instead of trying to reuse the .text section. BUG= https://code.google.com/p/nativeclient/issues/detail?id=4080 R=stichnot@chromium.org Review URL: https://codereview.chromium.org/948943004
-
Jim Stichnoth authored
Spec2k now runs sandboxed, using all filetypes (asm, iasm, obj). The new build-runtime.py script builds the native and sandboxed runtimes in build/runtime/ . The various Subzero driver scripts are updated to use that. Fixes a stack frame bug in sandboxed mode when the integrated assembler is used. The stack adjustment for setting up a function call wasn't being rolled back for the second emitIAS() pass, so stack variables passed as arguments to the callee were being copied from the wrong stack slot. Notes: 1. The hybrid Subzero/llc bisection debugging builds probably do not work as intended for -filetype=obj since the ELF emitter doesn't yet support -ffunction-sections. (This was also true for non-sandboxed hybrid builds.) 2. The cross tests have not yet been adapted for testing sandboxing. I'd prefer to first make progress on https://code.google.com/p/nativeclient/issues/detail?id=4085 in order to avoid blindly doubling the number of tests. BUG= https://code.google.com/p/nativeclient/issues/detail?id=4079 R=jvoung@chromium.org Review URL: https://codereview.chromium.org/944333002
-
- 20 Feb, 2015 2 commits
-
-
Jim Stichnoth authored
This removes ice_unreachable() from the Subzero runtime. The ice_unreachable() implementation is problematic since it makes a call to external function abort(), which leads to an undefined symbol error in the linker because abort() is internalized at link time. BUG= https://code.google.com/p/nativeclient/issues/detail?id=4091 R=jvoung@chromium.org Review URL: https://codereview.chromium.org/945953002
-
Jim Stichnoth authored
BUG= https://code.google.com/p/nativeclient/issues/detail?id=4079 R=jvoung@chromium.org, kschimpf@google.com Review URL: https://codereview.chromium.org/930733002
-
- 19 Feb, 2015 1 commit
-
-
Jan Voung authored
After the next LLVM merge, llvm-objdump is going to lose the "--symbolize" flag. It also sounds like llvm-objdump may at some point converge to the objdump-style of output. So, rather than keep updating test expectations, switch to objdump, assuming objdump will be more stable than llvm-objdump. Also stash the assembler/disassembler commandlines in the run-llvm2ice.py script. In theory this will let us tweak the commandlines more easily (one place). In practice the test expectatations will probably need to be adjusted if the base commandlines change though. Bulk edit the test expectations to match objdump now. Some of this is assisted by a python script. Example script: https://codereview.chromium.org/928663002/ BUG= https://code.google.com/p/nativeclient/issues/detail?id=4026 R=kschimpf@google.com, stichnot@chromium.org Review URL: https://codereview.chromium.org/914263005
-
- 13 Feb, 2015 5 commits
-
-
Karl Schimpf authored
BUG=None R=stichnot@chromium.org Review URL: https://codereview.chromium.org/923183002
-
Jim Stichnoth authored
Change crosstest.py's -elf argument to the now-standard -filetype and just pass it through to llvm2ice. This also fixes a leftover -elf-writer argument that should have been changed to -filetype=obj. It would be nice to change all the explicit -threads=0 to -threads=1 in the lit tests, but that uncovers too many assumptions about dump/emit output order, or ordering between function and global data emission. BUG= none R=kschimpf@google.com Review URL: https://codereview.chromium.org/924023002
-
Jan Voung authored
Makes it more uniform for a later bulk refactoring of "p2i | llvm-mc | llvm-objdump", so it only needs to match p2i and not lc2i. Some of the test expectations change though. Also there was a stray XCHECK that I don't remember why it was XCHECK... change that to CHECK. BUG= none R=stichnot@chromium.org Review URL: https://codereview.chromium.org/927433002
-
Jim Stichnoth authored
When filetype=asm, the Internal flag of the Cfg wasn't being copied to the Assembler, so all symbols were made global. This would cause multiply defined symbols in Spec, particularly main(). BUG= none R=jvoung@chromium.org Review URL: https://codereview.chromium.org/921043002
-
Jim Stichnoth authored
"make -f Makefile.standalone bloat" generates a json file containing ./llvm2ice size data, and launches google-chrome on the output. bloat.py is taken verbatim from https://github.com/martine/bloat/blob/master/bloat.py . webtreemap.{js,css} are taken verbatim from https://github.com/martine/webtreemap . llvm2ice.bloat.html is adapted from https://github.com/martine/webtreemap/blob/gh-pages/demo/demo.html . BUG= none R=jfb@chromium.org Review URL: https://codereview.chromium.org/917203002
-