Creating DAGs

All,

I apologize if this is an inappropriate question for this mailing
list. If so, please recommend an appropriate place to post the
question. I'm also somewhat new to LLVM, so I could have some pretty
fundamental misunderstandings about what I am trying to do. I have
searched for information on the llvm.org website (user's guide,
programmer's manual and doxygen documentation), and looked through the
3.1 source code. I have also searched the archives of this list.

My question is: Is it possible to create a DAG from an llvm::Module?
I would like to do this independent of a specific architecture using
LLVM IR. In particular, I am interested in using a DAG to compute the
Strahler number (Strahler number - Wikipedia) of the
graph to determine the minimum number of register needed to evaluate
an expression tree.

I have read through the documentation on SelectionDAG. However, this
seems to require a TargetMachine. Is there a way to create a graph
without a target? This may be a fundamental lack of understanding on
my part, if so please point me to something that might clarify.

Best Regards,
Ben

I apologize if this is an inappropriate question for this mailing
list.

This is the correct list.

My question is: Is it possible to create a DAG from an llvm::Module?
I would like to do this independent of a specific architecture using
LLVM IR. In particular, I am interested in using a DAG to compute the
Strahler number (Strahler number - Wikipedia) of the
graph to determine the minimum number of register needed to evaluate
an expression tree.

If you are actually interested in processor registers, I don't think it
makes sense to perform this computation at the LLVM IR level. The backend
changes the code too much to map such results from the IR to the generated
machine code, regardless of the platform. Are you after processor registers?
Then the ScheduleDAG you found is the one to use.