Skip to content
  1. May 11, 2011
    • Evan Cheng's avatar
      Add a late optimization to BranchFolding that hoist common instruction sequences · 05fc35e2
      Evan Cheng authored
      at the start of basic blocks to their common predecessor. It's actually quite
      common (e.g. about 50 times in JM/lencod) and has shown to be a nice code size
      benefit. e.g.
      
              pushq   %rax
              testl   %edi, %edi
              jne     LBB0_2
      ## BB#1:
              xorb    %al, %al
              popq    %rdx
              ret
      LBB0_2:
              xorb    %al, %al
              callq   _foo
              popq    %rdx
              ret
      
      =>
      
              pushq   %rax
              xorb    %al, %al
              testl   %edi, %edi
              je      LBB0_2
      ## BB#1:
              callq   _foo
      LBB0_2:
              popq    %rdx
              ret
      
      rdar://9145558
      
      llvm-svn: 131172
      05fc35e2
  2. Jun 22, 2010
  3. Nov 26, 2009
    • Bob Wilson's avatar
      Split tail duplication into a separate pass. This is needed to avoid · 2d4ff12d
      Bob Wilson authored
      running tail duplication when doing branch folding for if-conversion, and
      we also want to be able to run tail duplication earlier to fix some
      reg alloc problems.  Move the CanFallThrough function from BranchFolding
      to MachineBasicBlock so that it can be shared by TailDuplication.
      
      llvm-svn: 89904
      2d4ff12d
  4. Nov 17, 2009
  5. Nov 12, 2009
  6. Nov 11, 2009
  7. Oct 28, 2009
    • Bob Wilson's avatar
      Revert r85346 change to control tail merging by CodeGenOpt::Level. · 97b93126
      Bob Wilson authored
      I'm going to redo this using the OptimizeForSize function attribute.
      
      llvm-svn: 85426
      97b93126
    • Bob Wilson's avatar
      Record CodeGen optimization level in the BranchFolding pass so that we can · 9693f9d4
      Bob Wilson authored
      use it to control tail merging when there is a tradeoff between performance
      and code size.  When there is only 1 instruction in the common tail, we have
      been merging.  That can be good for code size but is a definite loss for
      performance.  Now we will avoid tail merging in that case when the
      optimization level is "Aggressive", i.e., "-O3".  Radar 7338114.
      
      Since the IfConversion pass invokes BranchFolding, it too needs to know
      the optimization level.  Note that I removed the RegisterPass instantiation
      for IfConversion because it required a default constructor.  If someone
      wants to keep that for some reason, we can add a default constructor with
      a hard-wired optimization level.
      
      llvm-svn: 85346
      9693f9d4
  8. Sep 04, 2009
Loading