- 26 Feb, 2015 2 commits
-
-
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
-
- 12 Feb, 2015 2 commits
-
-
Jim Stichnoth authored
This matches LLVM's -filetype={obj,asm} options, and also adds -filetype=iasm to get textual rendering with the integrated assembler. It also removes the old illegal combination of -ias=0 -elf-writer. BUG= none R=jvoung@chromium.org, kschimpf@google.com Review URL: https://codereview.chromium.org/920953002 -
Jim Stichnoth authored
(This is a continuation of https://codereview.chromium.org/876083007/ .) Emission is done in a separate thread when -threads=N with N>0 is specified. This includes both functions and global initializers. Emission is deterministic. The parser assigns sequence numbers, and the emitter thread reassembles work units into their original order, regardless of the number of threads. Dump output, however, is not intended to be in deterministic, reassembled order. As such, lit tests that test dump output (i.e., '-verbose inst') are explicitly run with -threads=0. For -elf-writer and -ias=1, the translator thread invokes Cfg::emitIAS() and the assembler buffer is passed to the emitter thread. For -ias=0, the translator thread passed the Cfg to the emitter thread which then invokes Cfg::emit() to produce the textual asm. Minor cleanup along the way: * Removed Flags from the Ice::Translator object and ctor, since it was redundant with Ctx->getFlags(). * Cfg::getAssembler<> is the same as Cfg::getAssembler<Assembler> and is useful for just passing the assembler around. * Removed the redundant Ctx argument from TargetDataLowering::lowerConstants() . BUG= https://code.google.com/p/nativeclient/issues/detail?id=4075 R=jvoung@chromium.org Review URL: https://codereview.chromium.org/916653004
-
- 10 Feb, 2015 1 commit
-
-
Karl Schimpf authored
Fixes the PNaCl bitcode reader to maintain two lists of global variables. The first, VariableDeclarations, is the list of variable declarations to be lowered by the emitter. The second, ValueIDConstants, is the corresponding constant symbol to use when references to the corresponding global variable declaration is referenced when processing functions. BUG=None R=jvoung@chromium.org, stichnot@chromium.org Review URL: https://codereview.chromium.org/883673005
-
- 09 Feb, 2015 1 commit
-
-
Karl Schimpf authored
Allows one to define explicit overrides in get accessors, based on compilation features. To show usage, modified SubConstantCalls to never be enabled if building a minimal llvm2ice. BUG=None R=stichnot@chromium.org Review URL: https://codereview.chromium.org/905463003
-
- 06 Feb, 2015 1 commit
-
-
Jan Voung authored
Followup to a previous code review. Saves 2KB from the minimal build =) BUG=none R=stichnot@chromium.org Review URL: https://codereview.chromium.org/904783002
-
- 05 Feb, 2015 1 commit
-
-
Karl Schimpf authored
When specified (via command line) replaces all called constant addresses with a stubbed call to the first defined function in the bitcode file. This allows testing of subzero without having to fix that downstream code (after parsing) may not handle such addresses. BUG=None R=jvoung@chromium.org Review URL: https://codereview.chromium.org/902713002
-
- 04 Feb, 2015 2 commits
-
-
Jan Voung authored
-
Jan Voung authored
Also note to keep that up to date. See also Patch set 1 of https://codereview.chromium.org/574133002/, vs later patch sets. Some things that were changed: (*) Headers / constants use Ice version (RegX8632::Encoded_Reg_eax vs EAX), (KB / MB -> other...) (*) Use llvm/Subzero allocator instead of Dart one. (*) Class/Field/On-stack-replacement/Dart runtime stuff is removed (*) Relocation/Fixups are now POD -- rather than a class with a virtual method for fixup. For now, we write out an ELF relocation, but later we may do a target pass to handle function calls within the same section, etc. (*) ASSERT -> assert (*) uword -> uintptr_t (should check). (*) clang-format (*) ??? BUG=none R=stichnot@chromium.org Review URL: https://codereview.chromium.org/901453002
-
- 03 Feb, 2015 4 commits
-
-
Jim Stichnoth authored
The unittest .o files also depend on some of the llvm2ice headers, as well as the unittest headers. To reproduce the problem, try this: make -f Makefile.standalone clean make -f Makefile.standalone check-unit 2>/dev/null | grep BitcodeMunge.cpp This will print a line containing BitcodeMunge.cpp. Now do: touch unittest/BitcodeMunge.h make -f Makefile.standalone check-unit 2>/dev/null | grep BitcodeMunge.cpp This should print a line, but it doesn't. Finally: touch src/PNaClTranslator.h make -f Makefile.standalone check-unit 2>/dev/null | grep BitcodeMunge.cpp This should also print a line, but it doesn't. With this patch, the unittest files get rebuilt after header file changes. BUG= none R=jvoung@chromium.org, kschimpf@google.com Review URL: https://codereview.chromium.org/895143003
-
Jan Voung authored
Also handle empty global variable lists -- and initialize ShAddralign to 1 instead of 0, just in case. Previously it would try to align by 0 when the variable list was empty. This should help the crosstests pass with --elf. BUG=none R=kschimpf@google.com, stichnot@chromium.org Review URL: https://codereview.chromium.org/899483002
-
Jan Voung authored
I'd like to bump the *trusted* clang compiler also, since the really old trusted clang compiler seems to crash if we pair old clang with new libcxx. (So the merge will probably have to bump the trusted clang compiler to a newer rev). BUG= https://code.google.com/p/nativeclient/issues/detail?id=4026 R=stichnot@chromium.org Review URL: https://codereview.chromium.org/898693002
-
Jim Stichnoth authored
The Cfg::create() method now returns a unique_ptr. Once the parser fully builds the Cfg, it is released onto the work queue, and then acquired and ultimately deleted by the translator thread. BUG= none R=jfb@chromium.org Review URL: https://codereview.chromium.org/892063002
-
- 01 Feb, 2015 2 commits
-
-
Jan Voung authored
Preliminary linking tests, seems to show that the linker and objcopy are happy to use 'em on spec2k, and the result runs! (Had to be careful to clobber the old .s and .o files to make it's testing the right copy). Haven't tried crosstests yet. BUG=none R=stichnot@chromium.org Review URL: https://codereview.chromium.org/889613004
-
Jim Stichnoth authored
This also implicitly applies to szbuild_spec2k.py. BUG= none R=jvoung@chromium.org Review URL: https://codereview.chromium.org/892803002
-
- 31 Jan, 2015 2 commits
-
-
Jim Stichnoth authored
Updates of current-function and cumulative stats are done entirely in TLS. At the end, cumulative stats are merged across all threads' TLS into the global cumulative stats. Printing of cumulative stats after every function is removed, since there's very little value from that. It was probably done in the first place just to give partial cumulative information in the face of crashes or assertion failures. BUG= none R=jfb@chromium.org Review URL: https://codereview.chromium.org/887213002
-
JF Bastien authored
MinGW's GCC 4.8.1 was sad because SectionType was shadowing the other SectionType. Also, the enum's values are in the ELFObjectWriter namespace, not ELFObjectWriter::SectionType. R=stichnot@chromium.org, jvoung@chromium.org BUG= Windows build is sad Review URL: https://codereview.chromium.org/891953002
-
- 30 Jan, 2015 2 commits
-
-
Jim Stichnoth authored
Now that multithreaded parsing and translation is in place, timer operations have to be made thread-local. After the non-main threads end, their thread-local timer data needs to be merged into the global timer data, which resides in the GlobalContext object. The merge is a bit tricky because the internal timer stack structure is built up dynamically as items are pushed and popped. Two threads may have radically different timing data: 1. The parser thread profile is completely different from a translator thread. 2. For -timing-funcs, two translator threads hold data for entirely different sets of functions. A bit more tweaking will need to be done to make the timing output fully usable in a multithreaded run. Because of multiple threads, times may add up to >100%. Also, time spent blocked is being "unfairly" attributed to the caller of the blocking operation - we should either count the user time instead of wall-clock time, or add a special timer marker for blocking locking operations. BUG= none R=jvoung@chromium.org Review URL: https://codereview.chromium.org/878383004
-
Jim Stichnoth authored
The problem showed up after the link step failed, in which case $(OBJDIR)/llvm2ice was deleted but the ./llvm2ice symlink still existed. A subsequent "make check-lit" or "make check" would fail, so the basic "make" would have to be done first. BUG= none R=jvoung@chromium.org Review URL: https://codereview.chromium.org/887873002
-
- 29 Jan, 2015 1 commit
-
-
Jan Voung authored
The local symbol relocations are a bit different from llvm-mc, which are section-relative. E.g., instead "bytes", it will be ".data + offsetof(bytes, .data)". So the contents of the text/data/rodata sections can also differ since the offsets written in place are different. Still need to fill the symbol table with undefined symbols (e.g., memset, and szrt lib functions) before trying to link. BUG=none R=kschimpf@google.com, stichnot@chromium.org Review URL: https://codereview.chromium.org/874353006
-
- 28 Jan, 2015 4 commits
-
-
JF Bastien authored
__attribute__((aligned(MaxCacheLineSize))) triggers a GCC bug because enum {MaxCacheLineSize = 64 }; isn't constant enough. Adding zero to it makes it that much more constant. R= stichnot@chromium.org BUG= https://gcc.gnu.org/bugzilla/show_bug.cgi?id=55382 Review URL: https://codereview.chromium.org/867483004 -
JF Bastien authored
The period, it was missing R= stichnot@chromium.org BUG= none . Review URL: https://codereview.chromium.org/888473002
-
JF Bastien authored
<mutex> is already included from IceDefs.h (where GlobalLockType is defined) but <condition_variable> isn't included anywhere. It's probably included indirectly in some standard libraries and not others, causing build failures on Windows. TBR= stichnot@chromium.org BUG= none Review URL: https://codereview.chromium.org/884283002
-
Karl Schimpf authored
Cleans up code by removing unnecessary fields/data structures in top-level parser of Subzero. In particular: 1) Uses FunctionDeclarationList.size() instead of NumFunctionIds. 2) Removes the need for vector DefiningFunctionDeclarationList. Instead uses an (incremented) index NextDefiningFunctionID into vector FunctionDeclarationList. BUG=None R=jvoung@chromium.org, stichnot@chromium.org Review URL: https://codereview.chromium.org/883493002
-