- 22 Jan, 2015 2 commits
-
-
JF Bastien authored
The following CL enables -Werror: https://codereview.chromium.org/863093002/ There were two warnings left in our subzero build: - Dead default cases because all of an enum's values were handled by the switch. - Use of C99 VLA. R=stichnot@chromium.org TEST= make check BUG= none Review URL: https://codereview.chromium.org/862853003
-
Karl Schimpf authored
The previous code did not do this. Also localizes the lock to when the error is actually printed. Note: requires https://codereview.chromium.org/865963002 BUG=None R=stichnot@chromium.org Review URL: https://codereview.chromium.org/864383002
-
- 20 Jan, 2015 3 commits
-
-
Jim Stichnoth authored
Elements were added to this vector, but never inspected, so it is essentially a useless field. Plus, the removal allows us to remove a couple of friend declarations. BUG=none R=kschimpf@google.com Review URL: https://codereview.chromium.org/814163004
-
Jim Stichnoth authored
This just gets the locking in place. Actual multithreading will be added later. Mutexes are added for accessing the GlobalContext allocator, the constant pool, the stats data, and the profiling timers. These are managed via the LockedPtr<> helper. Finer grain locks on the constant pool may be added later, i.e. a separate lock for each data type. An vector of pointers to TLS objects is added to GlobalContext. Each new thread will get its own TLS object, whose address is added to the vector. (After threads complete, things like stats can be combined by iterating over the vector.) The dump/emit streams are guarded by a separate lock, to avoid fine-grain interleaving of output by multiple threads. E.g., lock the streams, emit an entire function, and unlock the streams. This works for dumping too, though dump output for different passes on the same function may be interleaved with that of another thread. There is an OstreamLocker helper class to keep this simple. CodeStats is made an inner class of GlobalContext (this was missed on a previous CL). BUG= none R=jfb@chromium.org, jvoung@chromium.org, kschimpf@google.com Review URL: https://codereview.chromium.org/848193003
-
Karl Schimpf authored
BUG=None R=jvoung@chromium.org, stichnot@chromium.org Review URL: https://codereview.chromium.org/848473002
-
- 15 Jan, 2015 1 commit
-
-
Jim Stichnoth authored
This hasn't been used in a very long time, and there's no intention of using it again. Originally there was the idea of a "fast" block-local register allocator for an O1-like configuration, which would allocate registers for infinite-weight temporaries during target lowering, using a "local register manager". This verbose option was for tracing execution of this register manager. However, by now it seems unlikely that this would do a better/faster job than the current Om1 register allocation approach, which reuses the linear-scan code quite effectively and does very well at separation of concerns. So adios IceV_RegManager! BUG= none R=jvoung@chromium.org Review URL: https://codereview.chromium.org/831663008
-
- 13 Jan, 2015 1 commit
-
-
Jan Voung authored
Pass the full assembler pointer to the elf writer, so that it has access to both the text buffer and the fixups. Remove some child classes of AssemblerFixups. They didn't really do much, and were pretty much identical to the original AssemblerFixup class. Dart had a virtual method for fixups to do necessary patching, but we currently don't do the patching and just emit the relocations. TODO see if patching is more efficient than writing out relocations and letting the linker do the work. This CL also makes AssemblerFixups POD. Change the fixup kind to be a plain unsigned int, which the target can fill w/ target/container-specific values. Move the fwd declaration of Assembler to IceDefs and remove the others. Do similar for fwd declaration refactoring for ELFWriter. Make the createAssembler method return a std::unique_ptr. BUG=none R=stichnot@chromium.org Review URL: https://codereview.chromium.org/828873002
-
- 12 Jan, 2015 2 commits
-
-
Jim Stichnoth authored
BUG= none R=jvoung@chromium.org Review URL: https://codereview.chromium.org/848603002
-
Jim Stichnoth authored
BUG= none R=jvoung@chromium.org Review URL: https://codereview.chromium.org/846763002
-
- 09 Jan, 2015 6 commits
-
-
Jan Voung authored
This avoids doing getConstantSym to avoid hitting the global context's getConstantSym during emitIAS(), which may be desirable for multi-threading, since each function's emitIAS() should be able to happen on a separate thread. The stringification is moved till later, so it still happens, just without creating a constant relocatable w/ offset of 0. This ends up tickling an issue where -O0 on 252.eon now gets 2x as many page faults, and I'm not sure exactly why. This makes the overall time higher, though emit time is lower. When translating with -O2 # of page faults is about the same before/after, so that oddness is restricted to O0. Before this change, tweaking the slab size at O0 doesn't seem to affect as drastically as 2x swings either. To work around this, I turned the slab size of the assembler down to 32KB. === Move all the .L$type$poolid into a function (replacing getPoolEntryID). BUG=none R=stichnot@chromium.org Review URL: https://codereview.chromium.org/837553009
-
Karl Schimpf authored
Extends the NaCl bitcode munger so that the PNaClTranslator parser can be applied to the defined sequence of record values. BUG=None R=jvoung@chromium.org, stichnot@chromium.org Review URL: https://codereview.chromium.org/800883006
-
Jan Voung authored
Create the section, write the data and define the symbols in the symbol table. BUG=none R=stichnot@chromium.org Review URL: https://codereview.chromium.org/837393005
-
Jim Stichnoth authored
1. Use a reverse_range() adaptor for range-based reverse iteration through containers. 2. Remove the emitting of the commented llvm-mc command line. 3. Remove a few TODOs. 4. For commented-out declarations within a class T like this: // T(const T&) = delete; // T &operator=(const T &) = delete; Replace them with this: T(const T&) = default; T &operator=(const T &) = default; And try to keep them private where possible. 5. Make LivenessNode and TimerTreeNode into internal classes. BUG= none R=jvoung@chromium.org Review URL: https://codereview.chromium.org/830303003
-
Jan Voung authored
It doesn't seem to be used? BUG=none R=stichnot@chromium.org Review URL: https://codereview.chromium.org/840343002
-
Jim Stichnoth authored
BUG= none R=jvoung@chromium.org Review URL: https://codereview.chromium.org/812023003
-
- 23 Dec, 2014 1 commit
-
-
Jim Stichnoth authored
This reestablishes C++11 features lost after switching to llvm::ilist<> in two previous CLs: https://codereview.chromium.org/709533002/ https://codereview.chromium.org/794923002/ BUG= none R=jfb@chromium.org, jvoung@chromium.org Review URL: https://codereview.chromium.org/819403002
-
- 20 Dec, 2014 1 commit
-
-
Jim Stichnoth authored
This is limited to the src directory, and not (yet) the crosstest directory. BUG= none R=jfb@chromium.org Review URL: https://codereview.chromium.org/814353002
-
- 19 Dec, 2014 2 commits
-
-
Jim Stichnoth authored
In particular, node lists for in and out edges of a CfgNode, and the live range segment list in a Variable. This is done by making the Cfg allocator globally available through TLS, and providing the STL containers with an allocator struct that uses this. This also cleans up some other allocation-related issues: * The allocator is now hung off the Cfg via a pointer, rather than being embedded into the Cfg. This allows a const Cfg pointer to be stored in TLS while still allowing its allocator to be mutated. * Cfg is now created via a static create() method. * The redundant Cfg::allocateInst<> methods are removed. * The Variable::asType() method allocates a whole new Variable from the Cfg arena, rather than allocating it on the stack, removing the need for the move constructor in Variable and Operand. This is OK since asType() is only used for textual asm emission. * The same 1MB arena allocator is now used by the assembler as well. The fact that it wasn't changed over to be the same as Cfg and GlobalContext was an oversight. (It turns out this adds ~3MB to the translator memory footprint, so that could be tuned later.) BUG= none R=jfb@chromium.org, jvoung@chromium.org Review URL: https://codereview.chromium.org/802183004
-
Jim Stichnoth authored
Randomize the order that registers appear in the free list. Only randomize fully "equivalent" registers to ensure no extra spills. This adds the -randomize-regalloc option. This is a continuation of https://codereview.chromium.org/456033003/ which Matt owns. BUG= none R=jfb@chromium.org Review URL: https://codereview.chromium.org/807293003
-
- 15 Dec, 2014 4 commits
-
-
Karl Schimpf authored
Removes the need to model LLVM types from the minimal subzero build. It isn't removed from the nonminimal build because IceConverter still needs to be able to convert LLVM types to corresponding Ice types. Note that this CL reduces the size of Release+Min/llvm2ice (after strip) to about 638K bytes. BUG=None R=jvoung@chromium.org, stichnot@chromium.org Review URL: https://codereview.chromium.org/805943002
-
Karl Schimpf authored
Removes cast instruction checks (in PNaClTranslator.cpp) that used LLVM utilities to use locally defined methods instead. Remove the need to call naclbitc::DecodeCastOpcode and CastInst::castIsValid. Also removes two more calls to convertToLLVMType. BUG= None R=jvoung@chromium.org, stichnot@chromium.org Review URL: https://codereview.chromium.org/794823002
-
Jim Stichnoth authored
Moves the deletion of newly dead instructions into the main liveness() routine. The old livenessPostProcess() routine is renamed and now used purely for live range construction. The hack is removed in which live in-args have a custom live range segment added to avoid an artifact of the live ranges. It is replaced with a gentler hack that extends the instruction numbering range of the initial basic block to avoid the artifact. Since special live range segments no longer need to be prepended, the live range representation is simplified and we can always assume that segments are being appended, never prepended (and as before, never added to the middle). Some magic constants involving special instruction numbers are replaced with symbolic constants. BUG= none R=jvoung@chromium.org Review URL: https://codereview.chromium.org/802003003
-
Karl Schimpf authored
In Subzero, we only need to be able to convert 64 bit constants in bitcode files to the corresponding Ice integer or floating type. This CL extracts the minimal implementation needed for Subzero. The intent of this change is to remove loading unnecessary LLVM code into (minimal) llvm2ice. BUG=None R=stichnot@chromium.org Review URL: https://codereview.chromium.org/797323002
-
- 11 Dec, 2014 3 commits
-
-
Jim Stichnoth authored
Instead, extend 668a7a33 to include both CfgNode and Variable, keeping a pool of strings in the Cfg. BUG= none R=jvoung@chromium.org Review URL: https://codereview.chromium.org/798693003
-
Jim Stichnoth authored
Requires the LLVM option -track-memory to get meaningful results. BUG= none R=kschimpf@google.com Review URL: https://codereview.chromium.org/795063003
-
Jim Stichnoth authored
This is toward the goal of pulling non-POD fields out of the CfgNode class so that CfgNode can be arena-allocated and not leak memory. For now, PhiList and AssignList are defined as InstList. Ideally, they would be ilist<> of InstPhi and InstAssign, but SFINAE happens. BUG= none R=jvoung@chromium.org Review URL: https://codereview.chromium.org/794923002
-
- 10 Dec, 2014 2 commits
-
-
Jim Stichnoth authored
Instead, non-empty node names are kept in a single vector in the Cfg object. This is toward the goal of pulling non-POD fields out of the CfgNode class so that CfgNode can be arena-allocated and not leak memory. Also, actual setting of the node name is now guarded by ALLOW_DUMP. BUG= none R=jvoung@chromium.org, kschimpf@google.com Review URL: https://codereview.chromium.org/787333005
-
Karl Schimpf authored
Removes the need to call function llvm::DecodeBinaryOp. In turn, this removes the need for enum type llvm::Instruction::BinaryOps, llvm::Type.isFPOrFPVectorTy, and one call to llvm::convertToLLVMType. BUG= None R=jvoung@chromium.org, stichnot@chromium.org Review URL: https://codereview.chromium.org/788283002
-
- 09 Dec, 2014 1 commit
-
-
Karl Schimpf authored
Also removes the need for DataLayout. BUG=None R=stichnot@chromium.org Review URL: https://codereview.chromium.org/789483003
-
- 08 Dec, 2014 1 commit
-
-
Jim Stichnoth authored
Specifically, don't bother to collect "-timing" and "-szstats" information since they anyway don't get printed out under the MINIMAL build. This is done by using the ALLOW_DUMP flag to guard whether code and timing stats are collected. This ends up reducing the native translator size by about 3%. ALLOW_DUMP is used as the guard since it already guards the output of the collected data - no sense collecting the data if it can never be printed out. To minimize the number of ALLOW_DUMP tests, we push the tests into the timing/stats class methods. BUG= none R=jvoung@chromium.org, kschimpf@google.com Review URL: https://codereview.chromium.org/788713002
-
- 07 Dec, 2014 1 commit
-
-
Jim Stichnoth authored
This is consistent with how LLVM is built, and makes it easier to analyze the potential size of a translator build and what may be inappropriately brought into the build. BUG= none R=kschimpf@google.com Review URL: https://codereview.chromium.org/783023002
-
- 06 Dec, 2014 1 commit
-
-
Jim Stichnoth authored
BUG= none R=jvoung@chromium.org Review URL: https://codereview.chromium.org/775953003
-
- 05 Dec, 2014 1 commit
-
-
Jim Stichnoth authored
BUG= none R=kschimpf@google.com Review URL: https://codereview.chromium.org/785583002
-
- 04 Dec, 2014 4 commits
-
-
Jim Stichnoth authored
BUG= https://code.google.com/p/nativeclient/issues/detail?id=4006 R=kschimpf@google.com Review URL: https://codereview.chromium.org/773583004
-
Jim Stichnoth authored
This generally uses less memory and fewer allocations. Also removes the commented-out alternative implementation using std::set<>, which would almost certainly never be a good idea here. BUG= none R=jvoung@chromium.org Review URL: https://codereview.chromium.org/734053006
-
Jim Stichnoth authored
BUG= none R=jvoung@chromium.org Review URL: https://codereview.chromium.org/780783003
-
Jim Stichnoth authored
Profiling indicated a noticeable amount of time spent on malloc/free related to the std::list<> implementation of UnorderedRanges. Therefore, we change the implementation to be std::vector<>, and up-front reserve a conservative amount of space to avoid expansion. The push_back() operation is always constant time with no allocation. Removing an element from the middle of the vector is done by swapping with the last element and then popping the last element, which is reasonable in principle because it is used as an unordered collection. Because of the swapping trick, the UnorderedRanges iterators are changed to iterate in reverse. BUG= none R=jvoung@chromium.org Review URL: https://codereview.chromium.org/781683002
-
- 03 Dec, 2014 2 commits
-
-
Jan Voung authored
BUG=build failure R=kschimpf@google.com Review URL: https://codereview.chromium.org/773853005
-
Karl Schimpf authored
When LLVM 3.5 was merged, the handling of errors was broken. This is being fixed in the CL listed below. This CL fixes Subzero's call so that it will work with the CL listed below. Relavant LLVM CL: https://codereview.chromium.org/770853002 BUG= https://code.google.com/p/nativeclient/issues/detail?id=4006 R=jfb@chromium.org, stichnot@chromium.org Review URL: https://codereview.chromium.org/775173002
-
- 02 Dec, 2014 1 commit
-
-
Jan Voung authored
Able to write out the ELF file header w/ a text section, a symbol table, and string table. Write text buffer directly to file after translating each CFG. This means that the header is written out early w/ fake data and then we seek back and write the real header at the very end. Does not yet handle relocations, data, rodata, constant pools, bss, or -ffunction-sections, more than 64K sections or more than 2^24 symbols. Numbers w/ current NOASSERT=1 build on 176.gcc: w/out -elf-writer: 0.233771 (21.1%): [ 1287] emit 28MB .s file w/ -elf-writer: 0.051056 ( 5.6%): [ 1287] emit 2.4MB .o file BUG=none R=stichnot@chromium.org Review URL: https://codereview.chromium.org/678533005
-