[llvm-commits] [llvm] r80788 - /llvm/trunk/lib/Transforms/Instrumentation/OptimalEdgeProfiling.cpp
Daniel Dunbar
daniel at zuster.org
Wed Sep 2 22:34:35 PDT 2009
On Wed, Sep 2, 2009 at 6:59 AM, Andreas Neustifter<astifter-llvm at gmx.at> wrote:
> + // InsertedBlocks contains all blocks that were inserted for splitting an
> + // edge, this blocks do not have to be instrumented.
> + std::set<BasicBlock*> InsertedBlocks;
This should probably be a DenseSet.
> for (Function::iterator BB = F->begin(), E = F->end(); BB != E; ++BB) {
> - // Do not count blocks that where introduced by spliting critical edges.
> - if (!BlocksToInstrument.count(BB)) continue;
> + // Check if block was not inserted and thus does not have to be
> + // instrumented.
> + if (InsertedBlocks.count(BB)) continue;
>
> // Okay, we have to add a counter of each outgoing edge not in MST. If
> // the outgoing edge is not critical don't split it, just insert the
> @@ -176,8 +174,10 @@
> if (std::binary_search(MST.begin(), MST.end(), edge)) {
>
> // If the edge is critical, split it.
> - SplitCriticalEdge(TI,s,this);
> + bool wasInserted = SplitCriticalEdge(TI, s, this);
> Succ = TI->getSuccessor(s);
> + if(wasInserted)
'if(' -> 'if ('
- Daniel
More information about the llvm-commits
mailing list