Displaying 7 results from an estimated 7 matches for "idf_iterator".
Did you mean:
df_iterator
2007 Mar 18
4
[LLVMdev] idf_iterator and MachineFunctions
Hi,
I need to do an inverse-depth-first iteration over the basic blocks in
a machine function (i.e. starting from the last block and following
predecessor edges) for a liveness analysis I'm writing.
idf_iterator seems like it's almost the class I need, but it starts at
the first block in the function at present, rather than the last one
(because of the specialisiation of GraphTraits for
Inverse<MachineFunction*> - getEntryNode returns mf->front()). That
seems odd to me - you can only ever get...
2007 Mar 19
0
[LLVMdev] idf_iterator and MachineFunctions
...t iteration over the basic blocks in
> a machine function (i.e. starting from the last block and following
> predecessor edges) for a liveness analysis I'm writing.
As Gordon mentioned, there isn't a trivial way to do this, as there isn't
a single exit node in the MBB CFG.
> idf_iterator seems like it's almost the class I need, but it starts at
> the first block in the function at present, rather than the last one
> (because of the specialisiation of GraphTraits for
> Inverse<MachineFunction*> - getEntryNode returns mf->front()). That
> seems odd to me - yo...
2007 Mar 18
0
[LLVMdev] idf_iterator and MachineFunctions
On 2007-03-18, at 03:22, Lang Hames wrote:
> Is there a recommended way to find the final block (the one with
> successors={}) in a machine function?
This isn't a property of the CFG in the general case. However, the
UnifyFunctionExitNodes transformation/analysis provides it. From
getAnalysis<UnifyFunctionExitNodes>().getReturnBlock(), you can visit
the basic block
2008 Jan 23
1
[LLVMdev] Walking all the predecessors for a basic block
...ort/CFG.h"
#include "llvm/ADT/DepthFirstIterator.h"
#include "llvm/ADT/GraphTraits.h"
virtual bool runOnFunction(Function& F) {
//for each function iterating over the basic blocks
for (Function::iterator b = F.begin(); b != F.end(); ++b) {
for (idf_iterator<BasicBlock*> I=idf_begin(b); I!=idf_end(b);
++I) { // for each basic block walking over the predecessors in the
graph
BasicBlock* B = *I;
}
}
}
Am i doing something wrong ?, I did verify template specialisation
of the GraphTrait class for the BasicBlock class from the CFG.h file....
2008 Jan 22
0
[LLVMdev] Walking all the predecessors for a basic block
...DepthFirstIterator works on any datatype that has a specialization of
GraphTrait.
For your particular task, I *think* you would do the following
(someone else please correct me if I am wrong):
#include "llvm/Support/CFG.h"
#include "llvm/ADT/DepthFirstIterator.h"
for (idf_iterator<BasicBlock*> I=idf_begin(BB), E=idf_end(BB); I != E;
++I) {
BasicBlock* B = *I;
On Jan 22, 2008, at 6:11 AM, Prabhat Kumar Saraswat wrote:
> Hi all,
>
> Is there a way to walk through ALL the predecessors of a basic block
> in a CFG. I tried to iterate over the preds using...
2008 Jan 22
3
[LLVMdev] Walking all the predecessors for a basic block
Hi all,
Is there a way to walk through ALL the predecessors of a basic block
in a CFG. I tried to iterate over the preds using this method
for (pred_iterator PI = pred_begin(BB), E = pred_end(BB); PI != E; ++I) {
BasicBlock *PredBB = *PI;
}
but this only gives the immediate predecessors for a basic block.
For example, in this sample control flow graph.
entry -> bb1 -> bb2 -> bb4
2009 Apr 14
1
[LLVMdev] Depth First Sort of Machine Basic Blocks just before emitting code
Too obvious!
Thanks
Dan
On Apr 13, 2009, at 7:58 PM, John Mosby wrote:
> po_iterator (ADT/PostOrderIterator.h) ?
>
> On Mon, Apr 13, 2009 at 5:40 PM, Daniel M Gessel <gessel at apple.com>
> wrote:
> That looks like it does a preorder depth first traversal (I think).
> I'm looking for postorder. Is there a trivial transform between the
> two? (I don't know