1. 15 Apr, 2016 1 commit
  2. 14 Apr, 2016 1 commit
  3. 13 Apr, 2016 1 commit
  4. 11 Apr, 2016 3 commits
    • Reduce wait times for very large PEXE files. · 3018cf2b
      Karl Schimpf authored
      Investigated how many parser waits occur when the OptQ fills up. The
      current implementation has 64k entries, which for 10Mb examples, never
      fill up (but do come close to filling up).
      
      To test, I dropped the queue size down. The numbers I got was that the
      queue size plus the number of parse waits was within 2% of the total
      number of function blocks. Hence, once OptQ fills up a lot of slow
      notifies get applied.
      
      Hence, for scaling, I modifed the code to not wake up the parse thread
      (during a pop) until OptQ got half empty. The results were that once
      the Opt got up to size 1024, less than 100 notifies would be
      issued. From 1024 on, as the queue size doubled, the number of
      notifies would drop roughly in half.
      
      Based on this, I decided to add the feature that the OptQ did not wake
      up the waiting parse thread until half empty. Since the queue size was
      not shrunk, this CL shouldn't add any overhead for the PEXES we have,
      and very few waits with significantly largers than the current (10Mb)
      PEXES.
      
      BUG=None
      R=jpp@chromium.org
      
      Review URL: https://codereview.chromium.org/1877873002 .
    • Add "vmov.<dt> <Qd>, #<imm>" to integrated ARM assembler. · b627f094
      Karl Schimpf authored
      Adds the VMOV instruction to the integrated assembler. Because #<imm> is
      complex, and we don't currently have a special ARM class to encode
      constants defined by ARM method AdvSIMDExpandImm(), it currently only
      accepts (nonnegative) integer32 constants that can fit into 8 bits.
      
      There are no tests for this instruction, since there currently no
      callers to this instruction. However, John will be checking in a CL
      shortly that will use this instruction.
      
      Add example generator for vector add.
      
      BUG= https://bugs.chromium.org/p/nativeclient/issues/detail?id=4334
      R=jpp@chromium.org
      
      Review URL: https://codereview.chromium.org/1879463003 .
    • Subzero. ARM32. Fixes Insert/Extract v(8|16)i1 bug. · 79568d27
      John Porto authored
      Subzero emits the following sequence when extracting elements from a
      vector of i1:
      
      vmov.8 Rt, Dm[I]
      
      I should be scaled when accessing v4i1, and v8i1, i.e., to extract the
      n-th boolean in a v8i1, the emitted code should be
      
      vmov.8 Rt, Dm[I*n]
      
      Insertions are handled by changing the operands' types, so that a
      v4i1 is handled as a v4i32, and a v8i1, as a v8i16. I.e., to insert
      the n-th boolean into a v8i1, the emitted code should be
      
      mov.16 Dt[I], Rm
      
      instead of
      
      mov.8 Dt[I*n], Rm
      
      This clears the upper bits for that element.
      
      BUG=
      R=eholk@chromium.org
      
      Review URL: https://codereview.chromium.org/1876083004 .
  5. 09 Apr, 2016 2 commits
    • Subzero: Shorten and normalize strings in non-DUMP builds. · e922c236
      Jim Stichnoth authored
      Jump table labels change from ".Lxxxxx_yy" to "$Jxxxxx_yy".
      
      Pooled float labels change from ".L$float$xxxxyyyy" to "$Fxxxxyyyy".
      
      Pooled double labels change from ".L$double$xxxxxxxxyyyyyyyy" to "$Dxxxxxxxxyyyyyyyy".
      
      All these should in theory not conflict with C/C++ user symbols.
      
      Float labels now likely fit into short strings and don't require extra memory allocation.
      
      Double labels may exceed the limit - encoding in base64 instead of hex would fix that.  Or, directly use the binary bytes as the string value.
      
      BUG= none
      R=jpp@chromium.org
      
      Review URL: https://codereview.chromium.org/1868113002 .
    • Subzero: Improve the -timing output. · 9a23e431
      Jim Stichnoth authored
      For "Flat times" output, adds a column with cumulative percentage.  Also, since these percentages add up to less than 100% due to timer overhead, we go ahead and scale up all of the "Flat times" percentages proportionally, to make them add to 100%.  This makes it easier to compare breakdowns across different pexes.
      
      Also, simplify the output to be simple tabular without extra brackets and whatnot.  E.g.:
      
      Total across all functions - Cumulative times:
           Seconds   Pct  EventCnt TimerPath
          8.580407 82.6%         0 szmain
          8.580054 82.6%         0 szmain.parseModule
          8.405447 80.9%     46473 szmain.parseModule.parseFunctions
      ...
      Total across all functions - Flat times:
           Seconds   Pct CumPct  EventCnt TimerName
          1.354678 16.0%  16.0%    100716 linearScan
          1.131292 13.3%  29.3%    139419 liveness
          0.728727  8.6%  37.9%     46473 genCode
      ...
      
      BUG= none
      R=jpp@chromium.org, kschimpf@google.com
      
      Review URL: https://codereview.chromium.org/1870073005 .
  6. 07 Apr, 2016 1 commit
  7. 06 Apr, 2016 3 commits
  8. 05 Apr, 2016 4 commits
  9. 04 Apr, 2016 2 commits
  10. 02 Apr, 2016 3 commits
  11. 01 Apr, 2016 2 commits
  12. 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 .
  13. 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 .
  14. 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 .
  15. 25 Mar, 2016 1 commit
  16. 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 .
  17. 21 Mar, 2016 3 commits
  18. 17 Mar, 2016 2 commits
  19. 16 Mar, 2016 1 commit
  20. 15 Mar, 2016 2 commits