Skip to content
  1. Aug 06, 2010
  2. Jul 22, 2010
  3. Jun 29, 2010
    • Bob Wilson's avatar
      Reapply my if-conversion cleanup from svn r106939 with fixes. · 1e5da550
      Bob Wilson authored
      There are 2 changes relative to the previous version of the patch:
      
      1) For the "simple" if-conversion case, there's no need to worry about
      RemoveExtraEdges not handling an unanalyzable branch.  Predicated terminators
      are ignored in this context, so RemoveExtraEdges does the right thing.
      This might break someday if we ever treat indirect branches (BRIND) as
      predicable, but for now, I just removed this part of the patch, because
      in the case where we do not add an unconditional branch, we rely on keeping
      the fall-through edge to CvtBBI (which is empty after this transformation).
      
      The change relative to the previous patch is:
      
      @@ -1036,10 +1036,6 @@
           IterIfcvt = false;
         }
       
      -  // RemoveExtraEdges won't work if the block has an unanalyzable branch,
      -  // which is typically the case for IfConvertSimple, so explicitly remove
      -  // CvtBBI as a successor.
      -  BBI.BB->removeSuccessor(CvtBBI->BB);
         RemoveExtraEdges(BBI);
       
         // Update block info. BB can be iteratively if-converted.
      
      
      2) My patch exposed a bug in the code for merging the tail of a "diamond",
      which had previously never been exercised.  The code was simply checking that
      the tail had a single predecessor, but there was a case in
      MultiSource/Benchmarks/VersaBench/dbms where that single predecessor was
      neither edge of the diamond.  I added the following change to check for
      that:
      
      @@ -1276,7 +1276,18 @@
         // tail, add a unconditional branch to it.
         if (TailBB) {
           BBInfo TailBBI = BBAnalysis[TailBB->getNumber()];
      -    if (TailBB->pred_size() == 1 && !TailBBI.HasFallThrough) {
      +    bool CanMergeTail = !TailBBI.HasFallThrough;
      +    // There may still be a fall-through edge from BBI1 or BBI2 to TailBB;
      +    // check if there are any other predecessors besides those.
      +    unsigned NumPreds = TailBB->pred_size();
      +    if (NumPreds > 1)
      +      CanMergeTail = false;
      +    else if (NumPreds == 1 && CanMergeTail) {
      +      MachineBasicBlock::pred_iterator PI = TailBB->pred_begin();
      +      if (*PI != BBI1->BB && *PI != BBI2->BB)
      +        CanMergeTail = false;
      +    }
      +    if (CanMergeTail) {
             MergeBlocks(BBI, TailBBI);
             TailBBI.IsDone = true;
           } else {
      
      With these fixes, I was able to run all the SingleSource and MultiSource
      tests successfully.
      
      llvm-svn: 107110
      1e5da550
  4. Jun 28, 2010
  5. Jun 26, 2010
  6. Jun 22, 2010
  7. Jun 19, 2010
    • Bob Wilson's avatar
      Tidy. · 4581434c
      Bob Wilson authored
      llvm-svn: 106383
      4581434c
    • Evan Cheng's avatar
      Allow ARM if-converter to be run after post allocation scheduling. · 2d51c7c5
      Evan Cheng authored
      - This fixed a number of bugs in if-converter, tail merging, and post-allocation
        scheduler. If-converter now runs branch folding / tail merging first to
        maximize if-conversion opportunities.
      - Also changed the t2IT instruction slightly. It now defines the ITSTATE
        register which is read by instructions in the IT block.
      - Added Thumb2 specific hazard recognizer to ensure the scheduler doesn't
        change the instruction ordering in the IT block (since IT mask has been
        finalized). It also ensures no other instructions can be scheduled between
        instructions in the IT block.
      
      This is not yet enabled.
      
      llvm-svn: 106344
      2d51c7c5
    • Evan Cheng's avatar
      Fix an inverted condition. · cf9e8a98
      Evan Cheng authored
      llvm-svn: 106330
      cf9e8a98
  8. Jun 18, 2010
    • Evan Cheng's avatar
      Teach iff-converter to properly count # of dups. It was not skipping over... · c0e0d85b
      Evan Cheng authored
      Teach iff-converter to properly count # of dups. It was not skipping over dbg_value's which resulted in non-duplicated instructions being deleted. rdar://8104384.
      
      llvm-svn: 106323
      c0e0d85b
    • Bob Wilson's avatar
      Fix PR7372: Conditional branches (at least on ARM) are treated as predicated, · f82c8fcc
      Bob Wilson authored
      so when IfConverter::CopyAndPredicateBlock checks to see if it should ignore
      an instruction because it is a branch, it should not check if the branch is
      predicated.
      
      This case (when IgnoreBr is true) is only relevant from IfConvertTriangle,
      where new branches are inserted after the block has been copied and predicated.
      If the original branch is not removed, we end up with multiple conditional
      branches (possibly conflicting) at the end of the block.  Aside from any
      immediate errors resulting from that, this confuses the AnalyzeBranch functions
      so that the branches are not analyzable.  That in turn causes the IfConverter to
      think that the "Simple" pattern can be applied, and things go downhill fast
      because the "Simple" pattern does _not_ apply if the block can fall through.
      
      This is pretty fragile.  If there are other degenerate cases where AnalyzeBranch
      fails, but where the block may still fall through, the IfConverter should not
      perform its "Simple" if-conversion.  But, I don't know how to do that with the
      current AnalyzeBranch interface, so for now, the best thing seems to be to
      avoid creating branches that AnalyzeBranch cannot handle.
      
      Evan, please review!
      
      llvm-svn: 106291
      f82c8fcc
    • Stuart Hastings's avatar
      Add a DebugLoc parameter to TargetInstrInfo::InsertBranch(). This · 0125b641
      Stuart Hastings authored
      addresses a longstanding deficiency noted in many FIXMEs scattered
      across all the targets.
      
      This effectively moves the problem up one level, replacing eleven
      FIXMEs in the targets with eight FIXMEs in CodeGen, plus one path
      through FastISel where we actually supply a DebugLoc, fixing Radar
      7421831.
      
      llvm-svn: 106243
      0125b641
  9. Jun 16, 2010
  10. Jun 15, 2010
  11. Jun 14, 2010
  12. Jun 07, 2010
  13. Jun 05, 2010
  14. Jan 04, 2010
    • David Greene's avatar
      · 72e47cd6
      David Greene authored
      Change errs() to dbgs().
      
      llvm-svn: 92520
      72e47cd6
  15. Nov 21, 2009
  16. 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
  17. Oct 25, 2009
  18. Sep 04, 2009
  19. Aug 23, 2009
  20. Aug 22, 2009
  21. 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
  22. Jul 14, 2009
  23. Jul 12, 2009
  24. Jul 11, 2009
  25. Jun 25, 2009
Loading