[LLVMdev] TargetSpec

Schoedel, Kevin P kevin.p.schoedel at intel.com
Thu Feb 21 14:32:10 PST 2013


> The simplest solution is probably to just break it out into its own
> library.

That is how I prototyped, yes, with a lib/TargetSpec and
libLLVMTargetSpec.

One other point I'd like comment on, before I start submitting code,
is the build process to allow TargetSpec to collect information from .td
files of all enabled processors. I'm not terribly familiar with either
autoconf or cmake, so I'm not sure there isn't a better scheme than what
I've done. The desire is to accumulate tblgen output from the enabled
backends into a single place that the backend-independent TargetSpec.h
can refer to. Briefly, I propose an

    include/llvm/Config/TargetSpec.def

generated at configure/cmake time by the same methods as the other *.def
files, containing an #include for each backend:

    #include <ARM/GenTargetSpec.inc>
    #include <CppBackend/GenTargetSpec.inc>
    #include <Hexagon/GenTargetSpec.inc>
    ... and so on.

One point on which this differs from current backend tblgen output
files is that the base file names lack a prefix; this is because
the prefix, which is currently only used internally to each backend
library, does not appear to be knowable at configuration time --
e.g. PowerPC/PPC*.inc. (Related is that the relations between backends,
configure targets, and 'arch'es seems a bit muddled; in the more distant
future I'd like to make the TargetSpec Arch explicit in tablegen,
adjacent to the cpus and features.)

-- 
Kevin Schoedel, Software Developer, Intel of Canada





More information about the llvm-dev mailing list