[LLVMdev] vmkit variables internal representation

Tim Northover t.p.northover at gmail.com
Tue Jun 25 08:50:54 PDT 2013


Hi Alexandru,

> For the local variable Q, it seems that the compiler is optimizing and
> considering store i32 10691, i32* .... (into balance). Do you know how I can
> compile the code for preserving Q?

You've probably got to convince the compiler not to optimise since
eliminating those variables is probably one of the simpler things that
goes on during optimisation. I'd expect the unoptimised code to have
"alloca" instructions inside the function which represent those
variables.

I'm afraid I don't know the javac command-line option to do that
though. Your questions may be better answered on a Java list dealing
with that compiler.

> Ok, in the bytecode there is no string "P", "balance" etc. I assume they are
> preserved in internal globals.

Could be. Doesn't java use UTF-16 for its strings? If so, I'd be
looking for arrays of i16 for my names. Assuming they're there at all,
of course (depends on Java API, ABI and possibly optimisations LLVM
was able to perform).

If you post a full .ll file we may be able to say more. Or someone may
be along who knows the Java LLVM compiler off the top of their head.

Cheers.

Tim.



More information about the llvm-dev mailing list