[LLVMdev] leveraging back-end C compiler features in the gcc-based front-end

Bob Frankel
2009-05-04T01:19:53Z

i'm
looking into using llvm with
TI's MSP430, for which a C compiler from TI already exists; the idea
here is to use llc -march=c and then pass the generated C code on to
the TI compiler.  as it turns out, the TI C compiler supports a number
of (processor-specific) intrinsics that expose much of the underlying
CPU architecture directly to the C programmer -- registers,
pseudo-functions for enabling/disabling interrupts and reading/writing
status bits, etc.

is there a way to leverage these (non-gcc) intrinsics in the llvm
gcc-based frontend -- perhaps flagging their use in such a way that
they effectively "pass through" the optimizer and are emitted "as
is"
in the generated C code?   in some respects, you can think of this
usage as not unlike dropping inline asm code into the C sources.

bob frankel