Skip to content
  1. 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
  2. Apr 19, 2009
  3. Apr 18, 2009
  4. Apr 17, 2009
    • Evan Cheng's avatar
      Teach spiller to unfold instructions which modref spill slot when a scratch · b96a1082
      Evan Cheng authored
      register is available and when it's profitable.
      
      e.g.
           xorq  %r12<kill>, %r13
           addq  %rax, -184(%rbp)
           addq  %r13, -184(%rbp)
      ==>
           xorq  %r12<kill>, %r13
           movq  -184(%rbp), %r12
           addq  %rax, %r12
           addq  %r13, %r12
           movq  %r12, -184(%rbp)
      
      Two more instructions, but fewer memory accesses. It can also open up
      opportunities for more optimizations.
      
      llvm-svn: 69341
      b96a1082
  5. Apr 16, 2009
  6. Apr 15, 2009
  7. Apr 14, 2009
    • Dale Johannesen's avatar
      Do not force asm's to be chained if they don't touch · 83593f41
      Dale Johannesen authored
      memory and aren't volatile.  This was interfering with
      good scheduling.
      
      llvm-svn: 69008
      83593f41
    • Evan Cheng's avatar
      Fix PR3934 part 2. findOnlyInterestingUse() was not setting IsCopy and... · 9787183b
      Evan Cheng authored
      Fix PR3934 part 2. findOnlyInterestingUse() was not setting IsCopy and IsDstPhys which are returned by value and used by callee. This happened to work on the earlier test cases because of a logic error in the caller side.
      
      llvm-svn: 69006
      9787183b
    • Daniel Dunbar's avatar
      Make these errors more noticable in build logs. · 097f630d
      Daniel Dunbar authored
      llvm-svn: 68998
      097f630d
    • Bob Wilson's avatar
      Change SelectionDAG type legalization to allow BUILD_VECTOR operands to be · 59dbbb2b
      Bob Wilson authored
      promoted to legal types without changing the type of the vector.  This is
      following a suggestion from Duncan
      (http://lists.cs.uiuc.edu/pipermail/llvmdev/2009-February/019923.html).
      The transformation that used to be done during type legalization is now
      postponed to DAG legalization.  This allows the BUILD_VECTORs to be optimized
      and potentially handled specially by target-specific code.
      
      It turns out that this is also consistent with an optimization done by the
      DAG combiner: a BUILD_VECTOR and INSERT_VECTOR_ELT may be combined by
      replacing one of the BUILD_VECTOR operands with the newly inserted element;
      but INSERT_VECTOR_ELT allows its scalar operand to be larger than the
      element type, with any extra high bits being implicitly truncated.  The
      result is a BUILD_VECTOR where one of the operands has a type larger the
      the vector element type.
      
      Any code that operates on BUILD_VECTORs may now need to be aware of the
      potential type discrepancy between the vector element type and the
      BUILD_VECTOR operands.  This patch updates all of the places that I could
      find to handle that case.
      
      llvm-svn: 68996
      59dbbb2b
  8. Apr 13, 2009
  9. Apr 12, 2009
Loading