Skip to content
  1. Aug 23, 2009
  2. Aug 22, 2009
  3. Aug 11, 2009
  4. Aug 05, 2009
  5. Aug 03, 2009
    • David Greene's avatar
      · ec9bc288
      David Greene authored
      Re-apply LiveInterval index dumping patch, with fixes suggested by Bill
      and others.
      
      llvm-svn: 78003
      ec9bc288
  6. Aug 01, 2009
  7. Jul 25, 2009
    • Daniel Dunbar's avatar
      More migration to raw_ostream, the water has dried up around the iostream hole. · 0dd5e1ed
      Daniel Dunbar authored
       - Some clients which used DOUT have moved to DEBUG. We are deprecating the
         "magic" DOUT behavior which avoided calling printing functions when the
         statement was disabled. In addition to being unnecessary magic, it had the
         downside of leaving code in -Asserts builds, and of hiding potentially
         unnecessary computations.
      
      llvm-svn: 77019
      0dd5e1ed
  8. Jul 24, 2009
  9. Jul 22, 2009
    • David Greene's avatar
      · e88680e3
      David Greene authored
      Constify the key in Mi2IndexMap.
      
      llvm-svn: 76801
      e88680e3
  10. Jul 21, 2009
    • Chris Lattner's avatar
      revert r76602, 76603, and r76615, pending design discussions. · 1eede6c6
      Chris Lattner authored
      llvm-svn: 76646
      1eede6c6
    • David Greene's avatar
      · ef1f36d3
      David Greene authored
      Prefix IR dumps with LiveInterval indices when possible.  This turns
      this:
      
      	%ESI<def> = MOV32rr %EDI<kill>
      	ADJCALLSTACKDOWN64 0, %RSP<imp-def>, %EFLAGS<imp-def,dead>, %RSP<imp-use>
      	%reg1027<def> = MOVZX64rr32 %ESI
      	%reg1027<def> = ADD64ri8 %reg1027, 15, %EFLAGS<imp-def,dead>
      	%reg1027<def> = AND64ri8 %reg1027, -16, %EFLAGS<imp-def,dead>
      	%RDI<def> = MOV64rr %RSP
      	%RDI<def> = SUB64rr %RDI, %reg1027<kill>, %EFLAGS<imp-def,dead>
      	%RSP<def> = MOV64rr %RDI
      
      into this:
      
      4	%reg1024<def> = MOV32rr %EDI<kill>
      12	ADJCALLSTACKDOWN64 0, %RSP<imp-def>, %EFLAGS<imp-def,dead>, %RSP<imp-use>
      20	%reg1025<def> = MOVZX64rr32 %reg1024
      28	%reg1026<def> = MOV64rr %reg1025<kill>
      36	%reg1026<def> = ADD64ri8 %reg1026, 15, %EFLAGS<imp-def,dead>
      44	%reg1027<def> = MOV64rr %reg1026<kill>
      52	%reg1027<def> = AND64ri8 %reg1027, -16, %EFLAGS<imp-def,dead>
      60	%reg1028<def> = MOV64rr %RSP
      68	%reg1029<def> = MOV64rr %reg1028<kill>
      76	%reg1029<def> = SUB64rr %reg1029, %reg1027<kill>, %EFLAGS<imp-def,dead>
      84	%RSP<def> = MOV64rr %reg1029
      
      This helps greatly when debugging register allocation and coalescing
      problems.
      
      llvm-svn: 76615
      ef1f36d3
  11. Jul 17, 2009
  12. Jul 16, 2009
  13. Jul 14, 2009
  14. Jul 11, 2009
  15. Jul 10, 2009
  16. Jul 09, 2009
    • Lang Hames's avatar
      Improved tracking of value number kills. VN kills are now represented · dab7b06d
      Lang Hames authored
      as an (index,bool) pair. The bool flag records whether the kill is a
      PHI kill or not. This code will be used to enable splitting of live
      intervals containing PHI-kills.
      
      A slight change to live interval weights introduced an extra spill
      into lsr-code-insertion (outside the critical sections). The test 
      condition has been updated to reflect this.
      
      llvm-svn: 75097
      dab7b06d
  17. Jul 01, 2009
    • Evan Cheng's avatar
      Remove special handling of implicit_def. Fix a couple more bugs in... · 2a5efe14
      Evan Cheng authored
      Remove special handling of implicit_def. Fix a couple more bugs in liveintervalanalysis and coalescer handling of implicit_def.
      
      Note, isUndef marker must be placed even on implicit_def def operand or else the scavenger will not ignore it. This is necessary because -O0 path does not use liveintervalanalysis, it treats implicit_def just like any other def.
      
      llvm-svn: 74601
      2a5efe14
    • Evan Cheng's avatar
      Handle IMPLICIT_DEF with isUndef operand marker, part 2. This patch moves the... · d379e896
      Evan Cheng authored
      Handle IMPLICIT_DEF with isUndef operand marker, part 2. This patch moves the code to annotate machineoperands to LiveIntervalAnalysis. It also add markers for implicit_def that define physical registers. The rest, is just a lot of details.
      
      llvm-svn: 74580
      d379e896
  18. Jun 30, 2009
    • Evan Cheng's avatar
      Add a bit IsUndef to MachineOperand. This indicates the def / use register... · 0dc101b8
      Evan Cheng authored
      Add a bit IsUndef to MachineOperand. This indicates the def / use register operand is defined by an implicit_def. That means it can def / use any register and passes (e.g. register scavenger) can feel free to ignore them.
      
      The register allocator, when it allocates a register to a virtual register defined by an implicit_def, can allocate any physical register without worrying about overlapping live ranges. It should mark all of operands of the said virtual register so later passes will do the right thing.
      
      This is not the best solution. But it should be a lot less fragile to having the scavenger try to track what is defined by implicit_def.
      
      llvm-svn: 74518
      0dc101b8
  19. Jun 27, 2009
  20. Jun 19, 2009
  21. Jun 17, 2009
  22. Jun 14, 2009
  23. Jun 02, 2009
  24. May 26, 2009
    • Jeffrey Yasskin's avatar
      LiveVariables::VarInfo contains an AliveBlocks BitVector, which has as many · 7d287cb7
      Jeffrey Yasskin authored
      entries as there are basic blocks in the function.  LiveVariables::getVarInfo
      creates a VarInfo struct for every register in the function, leading to
      quadratic space use.  This patch changes the BitVector to a SparseBitVector,
      which doesn't help the worst-case memory use but does reduce the actual use in
      very long functions with short-lived variables.
      
      llvm-svn: 72426
      7d287cb7
  25. May 03, 2009
    • Evan Cheng's avatar
      In some rare cases, the register allocator can spill registers but end up not... · 210fc62a
      Evan Cheng authored
      In some rare cases, the register allocator can spill registers but end up not utilizing registers at all. The fundamental problem is linearscan's backtracking can end up freeing more than one allocated registers. However,  reloads and restores might be folded into uses / defs and freed registers might not be used at all.
      
      VirtRegMap keeps track of allocations so it knows what's not used. As a horrible hack, the stack coloring can color spill slots with *free* registers. That is, it replace reload and spills with copies from and to the free register. It unfold instructions that load and store the spill slot and replace them with register using variants.
      
      Not yet enabled. This is part 1. More coming.
      
      llvm-svn: 70787
      210fc62a
  26. Apr 27, 2009
  27. Apr 22, 2009
    • Evan Cheng's avatar
      It has finally happened. Spiller is now using live interval info. · 1a99a5f5
      Evan Cheng authored
      This fixes a very subtle bug. vr defined by an implicit_def is allowed overlap with any register since it doesn't actually modify anything. However, if it's used as a two-address use, its live range can be extended and it can be spilled. The spiller must take care not to emit a reload for the vn number that's defined by the implicit_def. This is both a correctness and performance issue.
      
      llvm-svn: 69743
      1a99a5f5
  28. Apr 20, 2009
    • Evan Cheng's avatar
      Added a linearscan register allocation optimization. When the register... · d67efaa8
      Evan Cheng authored
      Added a linearscan register allocation optimization. When the register allocator spill an interval with multiple uses in the same basic block, it creates a different virtual register for each of the reloads. e.g.
      
      	%reg1498<def> = MOV32rm %reg1024, 1, %reg0, 12, %reg0, Mem:LD(4,4) [sunkaddr39 + 0]
              %reg1506<def> = MOV32rm %reg1024, 1, %reg0, 8, %reg0, Mem:LD(4,4) [sunkaddr42 + 0]
              %reg1486<def> = MOV32rr %reg1506
              %reg1486<def> = XOR32rr %reg1486, %reg1498, %EFLAGS<imp-def,dead>
              %reg1510<def> = MOV32rm %reg1024, 1, %reg0, 4, %reg0, Mem:LD(4,4) [sunkaddr45 + 0]
      
      =>
      
              %reg1498<def> = MOV32rm %reg2036, 1, %reg0, 12, %reg0, Mem:LD(4,4) [sunkaddr39 + 0]
              %reg1506<def> = MOV32rm %reg2037, 1, %reg0, 8, %reg0, Mem:LD(4,4) [sunkaddr42 + 0]
              %reg1486<def> = MOV32rr %reg1506
              %reg1486<def> = XOR32rr %reg1486, %reg1498, %EFLAGS<imp-def,dead>
              %reg1510<def> = MOV32rm %reg2038, 1, %reg0, 4, %reg0, Mem:LD(4,4) [sunkaddr45 + 0]
      
      From linearscan's point of view, each of reg2036, 2037, and 2038 are separate registers, each is "killed" after a single use. The reloaded register is available and it's often clobbered right away. e.g. In thise case reg1498 is allocated EAX while reg2036 is allocated RAX. This means we end up with multiple reloads from the same stack slot in the same basic block.
      
      Now linearscan recognize there are other reloads from same SS in the same BB. So it'll "downgrade" RAX (and its aliases) after reg2036 is allocated until the next reload (reg2037) is done. This greatly increase the likihood reloads from SS are reused.
      
      This speeds up sha1 from OpenSSL by 5.8%. It is also an across the board win for SPEC2000 and 2006.
      
      llvm-svn: 69585
      d67efaa8
  29. Apr 13, 2009
  30. Apr 09, 2009
    • Bob Wilson's avatar
      Fix pr3954. The register scavenger asserts for inline assembly with · 51856173
      Bob Wilson authored
      register destinations that are tied to source operands.  The
      TargetInstrDescr::findTiedToSrcOperand method silently fails for inline
      assembly.  The existing MachineInstr::isRegReDefinedByTwoAddr was very
      close to doing what is needed, so this revision makes a few changes to
      that method and also renames it to isRegTiedToUseOperand (for consistency
      with the very similar isRegTiedToDefOperand and because it handles both
      two-address instructions and inline assembly with tied registers).
      
      llvm-svn: 68714
      51856173
  31. Apr 08, 2009
    • Dan Gohman's avatar
      Implement support for using modeling implicit-zero-extension on x86-64 · ad3e549a
      Dan Gohman authored
      with SUBREG_TO_REG, teach SimpleRegisterCoalescing to coalesce
      SUBREG_TO_REG instructions (which are similar to INSERT_SUBREG
      instructions), and teach the DAGCombiner to take advantage of this on
      targets which support it. This eliminates many redundant
      zero-extension operations on x86-64.
      
      This adds a new TargetLowering hook, isZExtFree. It's similar to
      isTruncateFree, except it only applies to actual definitions, and not
      no-op truncates which may not zero the high bits.
      
      Also, this adds a new optimization to SimplifyDemandedBits: transform
      operations like x+y into (zext (add (trunc x), (trunc y))) on targets
      where all the casts are no-ops. In contexts where the high part of the
      add is explicitly masked off, this allows the mask operation to be
      eliminated. Fix the DAGCombiner to avoid undoing these transformations
      to eliminate casts on targets where the casts are no-ops.
      
      Also, this adds a new two-address lowering heuristic. Since
      two-address lowering runs before coalescing, it helps to be able to
      look through copies when deciding whether commuting and/or
      three-address conversion are profitable.
      
      Also, fix a bug in LiveInterval::MergeInClobberRanges. It didn't handle
      the case that a clobber range extended both before and beyond an
      existing live range. In that case, multiple live ranges need to be
      added. This was exposed by the new subreg coalescing code.
      
      Remove 2008-05-06-SpillerBug.ll. It was bugpoint-reduced, and the
      spiller behavior it was looking for no longer occurrs with the new
      instruction selection.
      
      llvm-svn: 68576
      ad3e549a
  32. Mar 26, 2009
Loading