[LLVMdev] LLVM Graph Representation

Eli Friedman eli.friedman at gmail.com
Mon Jul 6 13:20:38 PDT 2009


On Mon, Jul 6, 2009 at 12:32 PM, Andre Tavares<andrelct at dcc.ufmg.br> wrote:
> I was thinking of a list of adjacency, implemented with a
> map<Instruction, Set<Node>>. The node would have an Instruction and a
> value. I opted for map and set, because I will create the graph once and
> will search on it a bunch of times, and will never remove a node.

Something like your proposal (I would suggest more specifically
llvm::DenseMap<Instruction*, std::vector<node> >) should work
reasonably well.  It's not particularly efficient, though, so if you
can avoid building an explicit graph, I'd suggest doing that.

-Eli



More information about the llvm-dev mailing list