[pypy-dev] Translating code to LLVM

Chris Lattner sabre at nondot.org
Sun Sep 11 06:11:06 CEST 2005


On Sun, 11 Sep 2005, Baptiste Lepilleur wrote:

> Following the getting started instruction, I'm trying to get the LLVM 
> translation pgcd example below.
>
> I'm on Windows XP using LLVM cvs build with VC++ 7.1.
...

>   raise ExecutionFailed(status, status, cmd, out, err)
> py.__.process.cmdexec.ExecutionFailed: ExecutionFailed: 1  llvm-as < 
> my_gcd_1.ll | opt -verify -lowe
> rsetjmp -funcresolve -raiseallocs -simplifycfg -mem2reg -globalopt -globaldce 
> -ipconstprop -deadarge
> lim -instcombine -simplifycfg -prune-eh -inline -simplify-libcalls 
> -argpromotion -raise -tailduplica
> te -simplifycfg -scalarrepl -instcombine -break-crit-edges -condprop 
> -tailcallelim -simplifycfg -rea
> ssociate -loopsimplify -licm -instcombine -indvars -loop-unroll -instcombine 
> -load-vn -gcse -sccp -i
> nstcombine -break-crit-edges -condprop -dse -mergereturn -adce -simplifycfg 
> -deadtypeelim -constmerg
> e -verify -f -o my_gcd_1.bc
> opt: Invalid Top Level Block Length! Type:1, Size:49557 (Vers=0, Pos=8)

This sounds like an LLVM problem: the assembler is producing an invalid 
bytecode file.  Either the .ll file is broken (in which case the 
assembler should have rejected it) or the bytecode writer is doing 
something wrong.  In any case, if you gzip up the source and email it to 
me, I'd be happy to look at it.

-Chris

> With PyPy SVN head, I get a more direct error:
>>>> print t.llvm()
> [...] truncated
> Traceback (most recent call last):
> File "<stdin>", line 1, in ?
> File "E:\prg\py\App\pypy\pypy\translator\translator.py", line 201, in llvm
>   filename = gen.gen_llvm_source()
> File "E:\prg\py\App\pypy\pypy\translator\llvm\genllvm.py", line 179, in 
> gen_llvm_source
>   codewriter.append(self.gcpolicy.declarations())
> AttributeError: 'NoneType' object has no attribute 'declarations'
>
> Does anyone know what I'm doing wrong ?
>
> On another topic, where do the generated files go ? I tried to find the files 
> generated by the c and llvm translation but couldn't find them...
>
> Baptiste. 
> _______________________________________________
> pypy-dev at codespeak.net
> http://codespeak.net/mailman/listinfo/pypy-dev
>

-Chris

-- 
http://nondot.org/sabre/
http://llvm.org/



More information about the Pypy-dev mailing list