[LLVMdev] Problem with missing support for non-zero contant initializers.

Tomas Lindquist Olsen tomas.l.olsen at gmail.com
Mon Aug 20 02:32:07 PDT 2007


On 8/20/07, Anton Korobeynikov <asl at math.spbu.ru> wrote:
> Hello, Tomas.
>
> > So far I have only been using LLVM at the user level. And I'm not sure
> > how this problem should be solved. It would be really nice if there
> > was a way to specify something like:
> > *******************************************************************
> > @_D9arrayinit5tableG32f = global [32 x float] [ 32 x float 0x7FF8000000000000 ]
> > *******************************************************************
> Are there any notion of static construction in D? If yes, you can just
> emit code to init array in runtime before main() is called (for example,
> llvm-gcc currently does so).
>

Hi Anton.

D does have static constructors. I just hoped I could avoid it, as
something like what I proposed above would be much cleaner in my code.
Also the execution times for these arrays seem to be quite out of
hand.
Should generating native assembly for a 32k element (truely) static
float lookup table really take 40seconds?

It does seem like I will have to go for the runtime approach though,
as I don't have time to figure out how to add this functionality to
LLVM right now. I'm doing this in my spare time, so I'd much rather
work on getting the language working correctly instead.

Thanx for the reply.

Regards,
Tomas



More information about the llvm-dev mailing list