Skip to content
  1. Dec 11, 2009
    • Bill Wendling's avatar
      Don't try to move a MBB into the fall-through position if it's a landing pad or · b87b9925
      Bill Wendling authored
      branches only to a landing pad. Without this check, the compiler would go into
      an infinite loop because the branch to a landing pad is an "abnormal" edge which
      wasn't being taken into account.
      
      This is the meat of that fix:
      
        if (!PrevBB.canFallThrough() && !MBB->BranchesToLandingPad(MBB)) {
      
      The other stuff is simplification of the "branches to a landing pad" code.
      
      llvm-svn: 91161
      b87b9925
  2. Dec 05, 2009
  3. Dec 03, 2009
  4. 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
  5. Nov 25, 2009
    • Bob Wilson's avatar
      Refactor target hook for tail duplication as requested by Chris. · d4d40670
      Bob Wilson authored
      Make tail duplication of indirect branches much more aggressive (for targets
      that indicate that it is profitable), based on further experience with
      this transformation.  I compiled 3 large applications with and without
      this more aggressive tail duplication and measured minimal changes in code
      size.  ("size" on Darwin seems to round the text size up to the nearest
      page boundary, so I can only say that any code size increase was less than
      one 4k page.) Radar 7421267.
      
      llvm-svn: 89814
      d4d40670
  6. Nov 19, 2009
  7. Nov 18, 2009
  8. Nov 17, 2009
  9. Nov 16, 2009
  10. Nov 13, 2009
  11. Nov 12, 2009
  12. Nov 11, 2009
  13. Nov 10, 2009
  14. Nov 04, 2009
    • Bob Wilson's avatar
      Fix branch folding bug for indirect branches: for a block containing only · 53a31ad3
      Bob Wilson authored
      an unconditional branch (possibly from tail merging), this code is
      trying to redirect all of its predecessors to go directly to the branch
      target, but that isn't feasible for indirect branches.  The other
      predecessors (that don't end with indirect branches) could theoretically
      still be handled, but that is not easily done right now.
      
      The AnalyzeBranch interface doesn't currently let us distinguish jump table
      branches from indirect branches, and this code is currently handling
      jump tables.  To avoid punting on address-taken blocks, we would have to give
      up handling jump tables.  That seems like a bad tradeoff.
      
      llvm-svn: 85975
      53a31ad3
  15. Oct 30, 2009
  16. Oct 29, 2009
  17. Oct 28, 2009
    • Bob Wilson's avatar
      Reimplement BranchFolding change to avoid tail merging for a 1 instruction · 3ab552ec
      Bob Wilson authored
      common tail, except when the OptimizeForSize function attribute is present.
      Radar 7338114.
      
      llvm-svn: 85441
      3ab552ec
    • 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
  18. Oct 22, 2009
    • Dan Gohman's avatar
      Revert the main portion of r31856. It was causing BranchFolding · ff97acd8
      Dan Gohman authored
      to break up CFG diamonds by banishing one of the blocks to the end of
      the function, which is bad for code density and branch size.
      
      This does pessimize MultiSource/Benchmarks/Ptrdist/yacr2, the
      benchmark cited as the reason for the change, however I've examined
      the code and it looks more like a case of gaming a particular
      branch than of being generally applicable.
      
      llvm-svn: 84803
      ff97acd8
  19. Sep 04, 2009
Loading