1. 04 Apr, 2016 1 commit
    • Subzero: Fix -timing-funcs and -timing-focus flags. · 318c01bc
      Jim Stichnoth authored
      1. Generate dummy FunctionXXX function names when either of those flags is given.
      
      2. Remove the browser code that automatically sets F/G prefixes instead of Function/Global, since that performance tweak is no longer relevant.
      
      3. Fix a presumably long-standing bug where -timing-focus would accumulate timings into the TLS copy of the timers, but would then try to print timing info based on the currently-empty GlobalContext copy of the timers.
      
      BUG= none
      R=kschimpf@google.com
      
      Review URL: https://codereview.chromium.org/1855683002 .
  2. 02 Apr, 2016 3 commits
  3. 01 Apr, 2016 2 commits
  4. 31 Mar, 2016 5 commits
    • Clean up Cl flag refrences in the bitcode parser. · 23866e7b
      Karl Schimpf authored
      The code previously had to navigate through 1 (or more) indirect
      pointers to find the CL flags. Since CL flags are a static field in
      the global context, simplify these references. Note: I have added
      member functions to do this (where appropriate) so that fixing code
      could be easy if we choose to move where the command line flags are
      stored.
      
      BUG=None
      R=eholk@chromium.org, stichnot@chromium.org
      
      Review URL: https://codereview.chromium.org/1845913003 .
    • Force sequential parsing when threads=0. · 3dd127e6
      Karl Schimpf authored
      When threads=0, it doesn't pay to run a parallel parse, since each
      parallel parse slows down parsing by requiring a copy of bits in the
      function block.
      
      BUG=None
      R=stichnot@chromium.org
      
      Review URL: https://codereview.chromium.org/1848873002 .
    • Subzero: Ignore variables with no actual uses. · cc89c959
      Jim Stichnoth authored
      Liveness analysis uses a pair of bit vectors in each CFG node.  The early bits correspond to "global" variables that are referenced in more than one block, and the latter bits correspond to "local" variables that are referenced in only that particular single block.
      
      Due to an oversight, variables that have no uses are conservatively classified as global, and consume space in every liveness bit vector.
      
      This CL improves memory usage by reducing liveness bit vector size:
      
      1. Identify variables with no actual uses and exclude them from the bit vectors.
      
      2. Don't do liveness analysis on rematerializable variables, because they have no need to be involved in register allocation or dead code elimination.
      
      BUG= https://bugs.chromium.org/p/nativeclient/issues/detail?id=4366
      R=jpp@chromium.org
      
      Review URL: https://codereview.chromium.org/1844713004 .
    • Subzero: Refine the memory usage report with -szstats . · b5eee3d7
      Jim Stichnoth authored
      The problem is that the memory usage that comes from the -track-memory option is not very well-defined (it's a hidden LLVM option after all).  It gives an OK sense of memory growth over time, but sometimes we really want to know how much CFG-local arena memory was allocated for a particular function.
      
      To help with this, we add another row to the stats output, giving the MB size of the CFG arena at the end of translating the method.
      
      BUG= https://bugs.chromium.org/p/nativeclient/issues/detail?id=4366
      R=kschimpf@google.com
      
      Review URL: https://codereview.chromium.org/1848733002 .
    • Allow Subzero to parse function blocks in parallel. · e8457a26
      Karl Schimpf authored
      This CL modifies the code so that we can do sequential and parallel
      parsing of function blocks in bitcode files, based on a command line
      argument.
      
      The command line argument was added because during testing, I had one
      compilation failure (transient), and do not know the cause. Hence, I
      was reluctant to install this CL without a command-line flag.
      
      To test the new parallel parser, the easiest solution is to edit
      IceClFlags.def and set the default value of ParseParallel to true.
      
      This code also fixes up unit parsing tests, as well as one parsing
      test.  The cause of these problems was the implicit assumption that
      function blocks are parsed sequentially, which no longer applies when
      function blocks are parsed in parallel. To fix this, the "threads=0"
      command line argument was added. It also added the starting up of
      worker threads, since parsing of function blocks will happen in the
      translation thread if parallel parsing is turned on.
      
      The OptQ queue was modified to contain OptWorkerItem instances with a
      single virtual to get the parsed code. This allows the IceConverter to
      continue to work, by simply passing the generated Cfg as a work item.
      
      BUG= https://bugs.chromium.org/p/nativeclient/issues/detail?id=4363
      R=jpp@chromium.org, stichnot@chromium.org
      
      Review URL: https://codereview.chromium.org/1834473002 .
  5. 30 Mar, 2016 1 commit
    • Subzero: Fix a bug in advanced phi lowering. · bbd449d2
      Jim Stichnoth authored
      The motivating example (simplified) is this:
      
      %__698:eax = phi i32 [ %__646:ebx, %__188 ] // LIVEEND={%__646:ebx}
      %__617:bh =  phi i8  [ %__618:ah,  %__188 ] // LIVEEND={%__618:ah}
      %__615:bl =  phi i8  [ %__616:al,  %__188 ] // LIVEEND={%__616:al}
      
      By default, it first lowers the __698 assignment.  However, that assignment has two "predecessors" because there are two other instructions whose dest variable aliases the __698 assignment's source operand.  This triggers an assertion failure where we assume there is only one predecessor.
      
      The fix is two-pronged.  First, we go ahead and generate as many temp assignments as needed to break the cycle, simply by changing an "if" to a "while".  Second, when we need to break a cycle, we give preference to an instruction with only one predecessor so that only one temp assignment needs to be added.
      
      (It might be possible to prove that the second approach, i.e. preferring single-predecessor assignments, makes the first approach unnecessary, i.e. changing "if" to "while".)
      
      This change has no effect on the x86 output for spec2k.
      
      BUG= https://bugs.chromium.org/p/nativeclient/issues/detail?id=4365
      R=jpp@chromium.org
      
      Review URL: https://codereview.chromium.org/1839263003 .
  6. 29 Mar, 2016 1 commit
    • Subzero: Remove IceString. · 467ffe51
      Jim Stichnoth authored
      The purpose is to get control over excess string creation and deletion, especially when the strings are long enough to involve malloc/free.
      
      Strings that interface with the outside world, or used for dump/debug, are now explicitly std::string.
      
      Variable names and node names are represented as string IDs and pooled locally in the CFG.  (In a non-DUMP build, this pool should always be empty.)
      
      Other strings that are used across functions are represented as string IDs and pooled globally in the GlobalContext.
      
      The --dump-strings flag allows these strings to be dumped for sanity checking, even in a MINIMAL build.  In a MINIMAL build, the set of strings includes external symbol names, intrinsic names, helper function names, and label names of pooled constants to facilitate deterministic ELF string table output.  For now, it also includes jump table entry names until that gets sorted out.
      
      Constants are fixed so that the name and pooled fields are properly immutable after the constant is fully initialized.
      
      BUG= https://bugs.chromium.org/p/nativeclient/issues/detail?id=4360
      R=jpp@chromium.org
      
      Review URL: https://codereview.chromium.org/1838753002 .
  7. 25 Mar, 2016 1 commit
  8. 24 Mar, 2016 1 commit
    • Subzero. Fixes valgrind errors. · 267f2bf9
      John Porto authored
      Valgrind used to report errors about uninitialized variable access in
      Subzero, when it was built with -O2. The problem was traced to
      
      size_t Alignment = Var->getAlignment;
      Alignment = std::max(MinAlignment, Var->getAlignment())
      
      Apparently, the compiler will not correctly zero-extend
      Var->getAlignment(), and thus Alignment's upper 32-bits would be
      garbage.
      
      BUG=
      R=kschimpf@google.com, stichnot@chromium.org
      
      Review URL: https://codereview.chromium.org/1825363003 .
  9. 21 Mar, 2016 3 commits
  10. 17 Mar, 2016 2 commits
  11. 16 Mar, 2016 1 commit
  12. 15 Mar, 2016 3 commits
  13. 14 Mar, 2016 1 commit
    • Subzero: Control whether deleted instructions are retained. · 76719b4a
      Jim Stichnoth authored
      Normally, deleted instructions are preserved in the Cfg, and printed as part of dump output.  This helps debugging by partially explaining the provenance of new instructions that originated from the deleted instructions.
      
      However, these instructions slow down iteration over the instruction list, and checking their deleted status may pollute the cache.
      
      As such, in a non-DUMP enabled build, we repurpose the renumberInstructions() pass to also unlink deleted instructions as needed.
      
      A flag is provided to override this behavior, in case we have to debug a situation where a bug only manifests in a DUMP build and not a non-DUMP build, or vice versa.
      
      BUG= https://bugs.chromium.org/p/nativeclient/issues/detail?id=4360
      R=eholk@chromium.org, jpp@chromium.org
      
      Review URL: https://codereview.chromium.org/1790063003 .
  14. 12 Mar, 2016 2 commits
  15. 11 Mar, 2016 4 commits
  16. 10 Mar, 2016 2 commits
  17. 09 Mar, 2016 5 commits
  18. 08 Mar, 2016 2 commits