1. 25 Aug, 2015 2 commits
  2. 24 Aug, 2015 4 commits
    • Josh Bleecher Snyder's avatar
      [dev.ssa] cmd/compile: streamline unimplemented strings · 5844603f
      Josh Bleecher Snyder authored
      This aids in making sense of the aggregate set of work outstanding.
      Interest in the details of any particular implementation failure
      is better handled locally anyway.
      
      In my local tree, running make.bash after this CL yields:
      
       14.85%  1811 SSA unimplemented: unhandled expr SLICEARR
       13.84%  1687 SSA unimplemented: unhandled expr CALLINTER
       11.84%  1444 SSA unimplemented: unhandled stmt RETJMP
       10.24%  1249 SSA unimplemented: unhandled expr EFACE
        8.52%  1039 SSA unimplemented: unhandled expr SLICE
        4.92%   600 SSA unimplemented: local variable with class PAUTO,heap unimplemented
        4.90%   598 SSA unimplemented: unhandled expr SLICESTR
        3.91%   477 SSA unimplemented: local variable with class PFUNC unimplemented
        3.45%   421 SSA unimplemented: not lowered: IMake INTER PTR64 PTR64
        3.42%   417 SSA unimplemented: unhandled expr APPEND
        3.21%   391 SSA unimplemented: unhandled expr CLOSUREVAR
        3.06%   373 SSA unimplemented: unhandled stmt DEFER
        3.04%   371 SSA unimplemented: unhandled stmt AS2DOTTYPE
        1.61%   196 SSA unimplemented: unhandled expr DOTTYPE
        1.56%   190 SSA unimplemented: not lowered: Load STRUCT PTR64 mem
        0.79%    96 SSA unimplemented: not lowered: StringMake STRING PTR64 UINTPTR
        0.69%    84 SSA unimplemented: unhandled binary op NE FLOAT64
        0.53%    65 SSA unimplemented: unhandled expr STRUCTLIT
        0.50%    61 SSA unimplemented: not lowered: SliceMake ARRAY PTR64 UINTPTR UINTPTR
        0.45%    55 SSA unimplemented: zero for type float64 not implemented
        0.44%    54 SSA unimplemented: unhandled addr CLOSUREVAR
        0.38%    46 SSA unimplemented: unhandled binary op EQ FLOAT64
        0.35%    43 SSA unimplemented: unhandled binary op LT FLOAT64
        0.34%    42 SSA unimplemented: unhandled len(map)
        0.33%    40 SSA unimplemented: unhandled stmt FALL
        0.23%    28 SSA unimplemented: CONVNOP closure
        0.21%    25 SSA unimplemented: local variable with class PPARAM,heap unimplemented
        0.21%    25 SSA unimplemented: unhandled binary op GT FLOAT64
        0.18%    22 SSA unimplemented: unhandled OCONV FLOAT32 -> FLOAT64
        0.18%    22 SSA unimplemented: unhandled expr REAL
        0.16%    20 SSA unimplemented: unhandled stmt PROC
        0.16%    19 SSA unimplemented: unhandled closure arg
        0.15%    18 SSA unimplemented: unhandled OCONV INT64 -> FLOAT64
        0.12%    15 SSA unimplemented: unhandled expr CFUNC
        0.10%    12 SSA unimplemented: unhandled OCONV UINT64 -> FLOAT64
        0.09%    11 SSA unimplemented: unhandled OLITERAL 4
        0.09%    11 SSA unimplemented: unhandled expr IMAG
        0.07%     9 SSA unimplemented: unhandled binary op GE FLOAT64
        0.07%     9 SSA unimplemented: unhandled binary op MINUS FLOAT64
        0.06%     7 SSA unimplemented: unhandled OCONV FLOAT64 -> FLOAT32
        0.06%     7 SSA unimplemented: unhandled binary op NE FLOAT32
        0.06%     7 SSA unimplemented: variable address class 5 not implemented
        0.05%     6 SSA unimplemented: not lowered: Load COMPLEX128 PTR64 mem
        0.05%     6 SSA unimplemented: unhandled expr SLICE3ARR
        0.04%     5 SSA unimplemented: unhandled binary op LE FLOAT64
        0.03%     4 SSA unimplemented: unhandled OCONV UINTPTR -> FLOAT64
        0.03%     4 SSA unimplemented: unhandled binary op EQ COMPLEX128
        0.03%     4 SSA unimplemented: unhandled binary op EQ FLOAT32
        0.03%     4 SSA unimplemented: unhandled expr COMPLEX
        0.02%     3 SSA unimplemented: local variable with class PPARAMOUT,heap unimplemented
        0.02%     3 SSA unimplemented: not lowered: Load ARRAY PTR64 mem
        0.02%     3 SSA unimplemented: unhandled OCONV INT32 -> FLOAT64
        0.02%     3 SSA unimplemented: unhandled OCONV INT64 -> FLOAT32
        0.02%     3 SSA unimplemented: unhandled expr SLICE3
        0.02%     2 SSA unimplemented: unhandled OCONV COMPLEX64 -> COMPLEX128
        0.02%     2 SSA unimplemented: unhandled OCONV FLOAT64 -> INT64
        0.02%     2 SSA unimplemented: unhandled OCONV FLOAT64 -> UINT64
        0.02%     2 SSA unimplemented: unhandled OCONV INT -> FLOAT64
        0.02%     2 SSA unimplemented: unhandled OCONV UINT64 -> FLOAT32
        0.02%     2 SSA unimplemented: unhandled binary op EQ COMPLEX64
        0.02%     2 SSA unimplemented: unhandled binary op MINUS FLOAT32
        0.02%     2 SSA unimplemented: zero for type complex128 not implemented
        0.02%     2 SSA unimplemented: zero for type complex64 not implemented
        0.02%     2 SSA unimplemented: zero for type float32 not implemented
        0.01%     1 SSA unimplemented: not lowered: EqFat BOOL INTER INTER
        0.01%     1 SSA unimplemented: not lowered: Store mem UINTPTR COMPLEX128 mem
        0.01%     1 SSA unimplemented: unhandled OCONV UINT32 -> FLOAT64
        0.01%     1 SSA unimplemented: unhandled cap(chan)
        0.01%     1 SSA unimplemented: unhandled expr ARRAYLIT
        0.01%     1 SSA unimplemented: unhandled expr PLUS
        0.01%     1 SSA unimplemented: unhandled stmt CHECKNIL
      
      Change-Id: I43474fe6d6ec22a9f57239090136f6e97eebfdf2
      Reviewed-on: https://go-review.googlesource.com/13848Reviewed-by: default avatarKeith Randall <khr@golang.org>
      5844603f
    • Josh Bleecher Snyder's avatar
      [dev.ssa] cmd/compile: support spilling and loading flags · 9f8f8c27
      Josh Bleecher Snyder authored
      This CL takes a simple approach to spilling and loading flags.
      We never spill. When a load is needed, we recalculate,
      loading the arguments as needed.
      
      This is simple and architecture-independent.
      It is not very efficient, but as of this CL,
      there are fewer than 200 flag spills during make.bash.
      
      This was tested by manually reverting CLs 13813 and 13843,
      causing SETcc, MOV, and LEA instructions to clobber flags,
      which dramatically increases the number of flags spills.
      With that done, all stdlib tests that used to pass
      still pass.
      
      For future reference, here are some other, more efficient
      amd64-only schemes that we could adapt in the future if needed.
      
      (1) Spill exactly the flags needed.
      
      For example, if we know that the flags will be needed
      by a SETcc or Jcc op later, we could use SETcc to
      extract just the relevant flag. When needed,
      we could use TESTB and change the op to JNE/SETNE.
      (Alternatively, we could leave the op unaltered
      and prepare an appropriate CMPB instruction
      to produce the desired flag.)
      
      However, this requires separate handling for every
      instruction that uses the flags register,
      including (say) SBBQcarrymask.
      
      We could enable this on an ad hoc basis for common cases
      and fall back to recalculation for other cases.
      
      (2) Spill all flags with PUSHF and POPF
      
      This modifies SP, which the runtime won't like.
      It also requires coordination with stackalloc to
      make sure that we have a stack slot ready for use.
      
      (3) Spill almost all flags with LAHF, SETO, and SAHF
      
      See http://blog.freearrow.com/archives/396
      for details. This would handle all the flags we currently
      use. However, LAHF and SAHF are not universally available
      and it requires arranging for AX to be free.
      
      Change-Id: Ie36600fd8e807ef2bee83e2e2ae3685112a7f276
      Reviewed-on: https://go-review.googlesource.com/13844Reviewed-by: default avatarKeith Randall <khr@golang.org>
      9f8f8c27
    • Josh Bleecher Snyder's avatar
      [dev.ssa] cmd/compile: mark LEA and MOV instructions as not clobbering flags · f3171994
      Josh Bleecher Snyder authored
      This further reduces the number of flags spills
      during make.bash by about 50%.
      
      Note that GetG is implemented by one or two MOVs,
      which is why it does not clobber flags.
      
      Change-Id: I6fede8c027b7dc340e00d1e15df1b87bf2b2d9ec
      Reviewed-on: https://go-review.googlesource.com/13843Reviewed-by: default avatarKeith Randall <khr@golang.org>
      f3171994
    • Josh Bleecher Snyder's avatar
      [dev.ssa] cmd/compile: make "*Value".String more robust · 220e7054
      Josh Bleecher Snyder authored
      Change-Id: I4ae38440a33574421c9e3e350701e86e8a224b92
      Reviewed-on: https://go-review.googlesource.com/13842Reviewed-by: default avatarTodd Neal <todd@tneal.org>
      Reviewed-by: default avatarKeith Randall <khr@golang.org>
      220e7054
  3. 22 Aug, 2015 1 commit
  4. 21 Aug, 2015 3 commits
  5. 20 Aug, 2015 1 commit
    • Keith Randall's avatar
      [dev.ssa] cmd/compile: add decompose pass · 9f954db1
      Keith Randall authored
      Decompose breaks compound objects up into pieces that can be
      operated on by the target architecture.  The decompose pass only
      does phi ops, the rest is done by the rewrite rules in generic.rules.
      
      Compound objects include strings,slices,interfaces,structs,arrays.
      
      Arrays aren't decomposed because of indexing (we could support
      constant indexes, but dynamic indexes can't be handled using SSA).
      Structs will come in a subsequent CL.
      
      TODO: after this pass we have lost the association between, e.g.,
      a string's pointer and its size.  It would be nice if we could keep
      that information around for debugging info somehow.
      
      Change-Id: I6379ab962a7beef62297d0f68c421f22aa0a0901
      Reviewed-on: https://go-review.googlesource.com/13683Reviewed-by: default avatarJosh Bleecher Snyder <josharian@gmail.com>
      9f954db1
  6. 19 Aug, 2015 3 commits
  7. 18 Aug, 2015 2 commits
  8. 17 Aug, 2015 4 commits
  9. 15 Aug, 2015 1 commit
    • Keith Randall's avatar
      [dev.ssa] cmd/compile/internal/ssa: Use explicit size for store ops · d4cc51d4
      Keith Randall authored
      Using the type of the store argument is not safe, it may change
      during rewriting, giving us the wrong store width.
      
      (Store ptr (Trunc32to16 val) mem)
      
      This should be a 2-byte store.  But we have the rule:
      
      (Trunc32to16 x) -> x
      
      So if the Trunc rewrite happens before the Store -> MOVW rewrite,
      then the Store thinks that the value it is storing is 4 bytes
      in size and uses a MOVL.  Bad things ensue.
      
      Fix this by encoding the store width explicitly in the auxint field.
      
      In general, we can't rely on the type of arguments, as they may
      change during rewrites.  The type of the op itself (as used by
      the Load rules) is still ok to use.
      
      Change-Id: I9e2359e4f657bb0ea0e40038969628bf0f84e584
      Reviewed-on: https://go-review.googlesource.com/13636Reviewed-by: default avatarJosh Bleecher Snyder <josharian@gmail.com>
      d4cc51d4
  10. 14 Aug, 2015 2 commits
  11. 13 Aug, 2015 6 commits
  12. 12 Aug, 2015 8 commits
  13. 11 Aug, 2015 3 commits