On Sep 10, 2008, at 2:33 AM, Dyson Wilkes wrote:
> Hi
>
> I am looking at some of the existing targets to try to understand more
> about writing a backend. I was a little puzzled by the use of a method
> ReplaceUses in *ISelDAGToDAG.cpp (*= most targets, e.g. ARM, X86..).
> I found its definition in the *GenDAGISel.inc file that is
> autogenerated from the target description. I can only assume TableGen
> emits this method definition for every traget. Is this method
> implementation, in some way that I cannot see, specific to a given
> target? I cannot see a reason for it not being a method of
> SelectionDAGISel and just implemented once?
Indeed it's generic. It's defined in DAGISelHeader.h We probably ought
to change the name to indicate it's specific to DAG isel though.
>
>
> Whilst the existing targets do offer a newcomer to LLWM a template to
> writing a new backend, can anyone point me to other sources of
> information to help me get up and running more quickly. I have read
> the
> various LLVM documents but, for example, the Writing an LLVM Backend
> and
> TableGen documents are rather high level. Am I going about this in
> the
> best way, i.e. trawling through the code and doxygen documents etc?
> Am
> I missing something?
There is not a lot of documentation beyond those. Right now, you need
to rely on this mailing list and your own experimentation with
existing targets. We've been talking about doing a tutorial on writing
a target port for LLVM Developer Meeting. But no one has found the
time to prepare such a elaborate talk yet. Perhaps next year! :-)
Evan
>
>
> Thanks for any help you can give,
>
> - Dyson
> _______________________________________________
> LLVM Developers mailing list
> LLVMdev at cs.uiuc.edu http://llvm.cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev