Skip to content
  1. Nov 06, 2010
  2. Nov 03, 2010
    • Evan Cheng's avatar
      Two sets of changes. Sorry they are intermingled. · debf9c50
      Evan Cheng authored
      1. Fix pre-ra scheduler so it doesn't try to push instructions above calls to
         "optimize for latency". Call instructions don't have the right latency and
         this is more likely to use introduce spills.
      2. Fix if-converter cost function. For ARM, it should use instruction latencies,
         not # of micro-ops since multi-latency instructions is completely executed
         even when the predicate is false. Also, some instruction will be "slower"
         when they are predicated due to the register def becoming implicit input.
         rdar://8598427
      
      llvm-svn: 118135
      debf9c50
  3. Oct 26, 2010
    • Bob Wilson's avatar
      When the "true" and "false" blocks of a diamond if-conversion are the same, · e1961fe2
      Bob Wilson authored
      do not double-count the duplicate instructions by counting once from the
      beginning and again from the end.  Keep track of where the duplicates from
      the beginning ended and don't go past that point when counting duplicates
      at the end.  Radar 8589805.
      
      This change causes one of the MC/ARM/simple-fp-encoding tests to produce
      different (better!) code without the vmovne instruction being tested.
      I changed the test to produce vmovne and vmoveq instructions but moving
      between register files in the opposite direction.  That's not quite the same
      but predicated versions of those instructions weren't being tested before,
      so at least the test coverage is not any worse, just different.
      
      llvm-svn: 117333
      e1961fe2
    • Bob Wilson's avatar
      Change if-conversion to keep track of the extra cost due to microcoded · efd360c5
      Bob Wilson authored
      instructions separately from the count of non-predicated instructions.  The
      instruction count is used in places to determine how many instructions to
      copy, predicate, etc. and things get confused if that count includes the
      extra cost for microcoded ops.
      
      llvm-svn: 117332
      efd360c5
  4. Oct 19, 2010
    • Owen Anderson's avatar
      Get rid of static constructors for pass registration. Instead, every pass... · 6c18d1aa
      Owen Anderson authored
      Get rid of static constructors for pass registration.  Instead, every pass exposes an initializeMyPassFunction(), which
      must be called in the pass's constructor.  This function uses static dependency declarations to recursively initialize
      the pass's dependencies.
      
      Clients that only create passes through the createFooPass() APIs will require no changes.  Clients that want to use the
      CommandLine options for passes will need to manually call the appropriate initialization functions in PassInitialization.h
      before parsing commandline arguments.
      
      I have tested this with all standard configurations of clang and llvm-gcc on Darwin.  It is possible that there are problems
      with the static dependencies that will only be visible with non-standard options.  If you encounter any crash in pass
      registration/creation, please send the testcase to me directly.
      
      llvm-svn: 116820
      6c18d1aa
  5. Oct 12, 2010
  6. Oct 08, 2010
  7. Oct 02, 2010
  8. Sep 30, 2010
  9. Sep 28, 2010
  10. Sep 10, 2010
    • Evan Cheng's avatar
      Teach if-converter to be more careful with predicating instructions that would · bf407075
      Evan Cheng authored
      take multiple cycles to decode.
      For the current if-converter clients (actually only ARM), the instructions that
      are predicated on false are not nops. They would still take machine cycles to
      decode. Micro-coded instructions such as LDM / STM can potentially take multiple
      cycles to decode. If-converter should take treat them as non-micro-coded
      simple instructions.
      
      llvm-svn: 113570
      bf407075
  11. Aug 06, 2010
  12. Jul 22, 2010
  13. 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
  14. Jun 28, 2010
  15. Jun 26, 2010
  16. Jun 22, 2010
  17. 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
  18. 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
  19. Jun 16, 2010
  20. Jun 15, 2010
  21. Jun 14, 2010
  22. Jun 07, 2010
  23. Jun 05, 2010
  24. Jan 04, 2010
    • David Greene's avatar
      · 72e47cd6
      David Greene authored
      Change errs() to dbgs().
      
      llvm-svn: 92520
      72e47cd6
Loading