~ubuntu-branches/ubuntu/quantal/llvm-3.1/quantal

« back to all changes in this revision

Viewing changes to lib/CodeGen/MachineBlockPlacement.cpp

  • Committer: Package Import Robot
  • Author(s): Sylvestre Ledru
  • Date: 2012-04-10 23:38:33 UTC
  • mfrom: (1.1.2)
  • Revision ID: package-import@ubuntu.com-20120410233833-5ibwguerdnr58six
Tags: 3.1~svn154439-1
* New snapshot release
* Change the soname to match what Debian is expecting
* Clean up the dh_shlibdeps call

Show diffs side-by-side

added added

removed removed

Lines of Context:
141
141
    }
142
142
  }
143
143
 
 
144
#ifndef NDEBUG
 
145
  /// \brief Dump the blocks in this chain.
 
146
  void dump() LLVM_ATTRIBUTE_USED {
 
147
    for (iterator I = begin(), E = end(); I != E; ++I)
 
148
      (*I)->dump();
 
149
  }
 
150
#endif // NDEBUG
 
151
 
144
152
  /// \brief Count of predecessors within the loop currently being processed.
145
153
  ///
146
154
  /// This count is updated at each loop we process to represent the number of
430
438
  for (SmallVectorImpl<MachineBasicBlock *>::iterator WBI = WorkList.begin(),
431
439
                                                      WBE = WorkList.end();
432
440
       WBI != WBE; ++WBI) {
433
 
    assert(!BlockFilter || BlockFilter->count(*WBI));
434
441
    BlockChain &SuccChain = *BlockToChain[*WBI];
435
442
    if (&SuccChain == &Chain) {
436
443
      DEBUG(dbgs() << "    " << getBlockName(*WBI)
540
547
MachineBlockPlacement::findBestLoopTop(MachineFunction &F,
541
548
                                       MachineLoop &L,
542
549
                                       const BlockFilterSet &LoopBlockSet) {
 
550
  // We don't want to layout the loop linearly in all cases. If the loop header
 
551
  // is just a normal basic block in the loop, we want to look for what block
 
552
  // within the loop is the best one to layout at the top. However, if the loop
 
553
  // header has be pre-merged into a chain due to predecessors not having
 
554
  // analyzable branches, *and* the predecessor it is merged with is *not* part
 
555
  // of the loop, rotating the header into the middle of the loop will create
 
556
  // a non-contiguous range of blocks which is Very Bad. So start with the
 
557
  // header and only rotate if safe.
 
558
  BlockChain &HeaderChain = *BlockToChain[L.getHeader()];
 
559
  if (!LoopBlockSet.count(*HeaderChain.begin()))
 
560
    return L.getHeader();
 
561
 
543
562
  BlockFrequency BestExitEdgeFreq;
544
563
  MachineBasicBlock *ExitingBB = 0;
545
564
  MachineBasicBlock *LoopingBB = 0;