[LLVMdev] LLVM targeting HLLs

David Given dg at cowlark.com
Tue Jan 25 03:15:29 PST 2011


On 25/01/11 00:17, David A. Greene wrote:
[...]
> The rewrite is happening.  I've got the skeleton of the codegen done,
> but I have to get it to build before I can check it in.  After that,
> everyone can start adding patterns.

Is the new C backend 'register' based, that is, generating lots of
little statements operating on lots of variables, rather than producing
the huge mangled expressions that the old one does? If so, that would be
ideal for what I want.

[...]
> Once I get the new C backend checked in (next week, hopefully), it may
> be helpful as a guide.

Excellent --- I'll wait for that, then. Will it be announced here?

[...]
> LLVM IR throws too much information away to target a HLL
> effectively.

The thing is, I explicitly don't want to use the Clang AST --- I'm not
interested in producing an idiomatic translation, merely a
fast-performing one. Clue in its current lousy state has proven that
this is possible; without any optimisation I'm getting C-to-Java at 60%
of native, and C-to-Luajit at 10%. I now want to see what sort of
results I get when applying LLVM's optimisations and some more
intelligence to the code generation. (Plus, Sparse is buggy and really
awkward to work with.)

For giggles, here's some example Javascript produced by Clue.

function _dtime(fp, stack) {
var sp;
var H0;
var H1;
var H2;
var H3;
var H4;
var state = 0;
for (;;) {
switch (state) {
case 0:
sp = 2;
sp = fp + sp;
H1 = null;
H0 = 0;
H2 = fp;
H3 = _gettimeofday;
H4 = H3(sp, stack, H2, stack, H0, H1);
H0 = fp;
H1 = stack[H0 + 0];
H0 = fp;
H2 = stack[H0 + 1];
H0 = 1000000.000000;
H3 = H2 / H0;
H0 = H1 + H3;
return H0;
} } }


(PS. Can people please reply to the list instead of to me directly?)

-- 
┌─── dg@cowlark.com ───── http://www.cowlark.com ─────
│
│ life←{ ↑1 ⍵∨.^3 4=+/,¯1 0 1∘.⊖¯1 0 1∘.⌽⊂⍵ }
│ --- Conway's Game Of Life, in one line of APL

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 262 bytes
Desc: OpenPGP digital signature
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20110125/7f73256c/attachment.sig>


More information about the llvm-dev mailing list