[LLVMdev] Polly test and example

James Molloy james.molloy at arm.com
Fri Jun 10 00:38:44 PDT 2011


Hi,

> out.s: Assembler messages:
> out.s:8: Error: bad register name `%rsp'
> out.s:9: Error: bad register name `%rsp)'
> out.s:12: Error: invalid instruction suffix for `call'
> out.s:14: Error: bad register name `%rax'
> out.s:18: Error: bad register name `%rcx'
> out.s:22: Error: bad register name `%rcx)'
> out.s:23: Error: bad register name `%rsp,%rcx,4)'
> out.s:24: Error: bad register name `%rdx'
> out.s:29: Error: bad register name `%rax'
> out.s:36: Error: bad register name `%rsp,%rax,4)'
> out.s:39: Error: bad register name `%rsp)'
> out.s:42: Error: bad register name `%rsp)'
> out.s:44: Error: bad register name `%rsp)'
> out.s:45: Error: bad register name `%rsp'
> tomohiro at ubuntu:~$

llc compiled the test for 64-bit X86, and you're assembling with a 32-bit
assembler. Try the -m32 option.

Cheers,

James

> -----Original Message-----
> From: llvmdev-bounces at cs.uiuc.edu [mailto:llvmdev-bounces at cs.uiuc.edu]
> On Behalf Of MORIYAMA Tomohiro
> Sent: 10 June 2011 06:58
> To: Tobias Grosser
> Cc: llvmdev at cs.uiuc.edu
> Subject: Re: [LLVMdev] Polly test and example
> 
> (2011/06/10 14:01), Tobias Grosser wrote:
> > On 06/10/2011 01:52 AM, MORIYAMA Tomohiro wrote:
> >> (2011/06/10 13:25), Tobias Grosser wrote:
> >>> On 06/10/2011 12:00 AM, MORIYAMA Tomohiro wrote:
> >>>> H, Tobias
> >>>> Thank you for your reply.
> >>>>
> >>>>
> >>>> Tobias Grosser wrote:
> >>>>> Interesting. On what kind of Platform are you running this? Is it
> >>>>> still
> >>>>> Ubuntu 11.04? I assume it's an intel platform, but is it a 32-bit
> or
> >>>>> 64bit?
> >>>>
> >>>> It is a little bit complicated.
> >>>>
> >>>> Intel Core i5 M520.
> >>>> Ubuntu 11.04-i386 using VMWare Player on Windows 7
> Professional(64bit).
> >>>
> >>> So it's 32bit.
> >>
> >> Certainly.
> >>
> >>>>>
> >>>>> The test cases that are failing are the ones that use 'lli' to
> execute
> >>>>> the generated program. There seems to be something wrong in
> respect to
> >>>>> lli. Can you run e.g. single_loop.ll with llvm-lit (-v) and show
> the
> >>>>> error message.
> >>>>
> >>>> OK. This is the message.
> >>>>
> >>>> --------
> >>>> tomohiro at ubuntu:~/llvm/tools/polly/test/CodeGen$ llvm-lit -v
> >>>> single_loop.ll
> >>>> llvm-lit: lit.cfg:94: note: using out-of-tree build at
> >>>> '/home/tomohiro/build/
> >>>> tools/polly'
> >>>> -- Testing: 1 tests, 2 threads --
> >>>> FAIL: Polly :: CodeGen/single_loop.ll (1 of 1)
> >>>> ******************** TEST 'Polly :: CodeGen/single_loop.ll' FAILED
> >>>> *************
> >>>> *******
> >>>> Script:
> >>>> --
> >>>> opt -load /home/tomohiro/build/lib/LLVMPolly.so -basicaa
> >>>> -polly-prepare -polly
> >>>> -region-simplify -scev-aa -polly-cloog -analyze<
> >>>> /home/tomohiro/llvm/tools/
> >>>> polly/test/CodeGen/single_loop.ll | FileCheck
> >>>> /home/tomohiro/llvm/tools/polly/
> >>>> test/CodeGen/single_loop.ll
> >>>> opt -load /home/tomohiro/build/lib/LLVMPolly.so -basicaa
> >>>> -polly-prepare -polly
> >>>> -region-simplify -scev-aa -polly-codegen<
> >>>> /home/tomohiro/llvm/tools/polly/test
> >>>> /CodeGen/single_loop.ll | lli -
> >>>> --
> >>>> Exit Code: 139
> >>>> Command Output (stderr):
> >>>> --
> >>>> Stack dump:
> >>>> 0. Program arguments: lli -
> >>>>
> /home/tomohiro/build/tools/polly/test/CodeGen/Output/single_loop.ll.scr
> ipt:
> >>>>
> >>>>
> >>>> line
> >>>> 2: 3250 Done opt -load /home/tomohiro/build/lib/LLVMPolly.so
> >>>> -basicaa -polly-prepare -polly-region-simplify -scev-aa
> >>>> -polly-codegen< /home/
> >>>> tomohiro/llvm/tools/polly/test/CodeGen/single_loop.ll
> >>>> 3251 Segmentation fault | lli -
> >>>
> >>>
> >>> Interesting. It seems lli is segfaulting. Can you try to use the
> >>> following command?
> >>>
> >>> opt -load /home/tomohiro/build/lib/LLVMPolly.so \
> >>> -basicaa -polly-prepare -polly-region-simplify -scev-aa \
> >>> -polly-codegen \
> >>> /home/tomohiro/llvm/tools/polly/test/CodeGen/single_loop.ll \
> >>> | llc - out.s && gcc out.s && ./a.out
> >>>
> >>> This means we do not run the created LLVM-IR file with the lli JIT
> >>> compiler, but use the llc compiler and than gcc to statically
> compile
> >>> the binary.
> >>
> >> OK. This result is as follows.
> >>
> >> tomohiro at ubuntu:~/llvm/tools/polly/test/CodeGen$ opt -load
> >> /home/tomohiro/build/lib/LLVMPolly.so \
> >> > -basicaa -polly-prepare -polly-region-simplify -scev-aa \
> >> > -polly-codegen \
> >> > /home/tomohiro/llvm/tools/polly/test/CodeGen/single_loop.ll \
> >> > | llc - out.s && gcc out.s && ./a.out
> >> llc: Too many positional arguments specified!
> >> Can specify at most 1 positional arguments: See: llc -help
> >
> > Sorry, the last line should be:
> > | llc -o out.s && gcc out.s && ./a.out
> 
> This is the corrected result.
> 
> tomohiro at ubuntu:~$ opt -load /home/tomohiro/build/lib/LLVMPolly.so \
>  >  -basicaa -polly-prepare -polly-region-simplify -scev-aa \
>  >  -polly-codegen \
>  >  /home/tomohiro/llvm/tools/polly/test/CodeGen/single_loop.ll \
>  >  | llc -o out.s && gcc out.s && ./a.out
> out.s: Assembler messages:
> out.s:8: Error: bad register name `%rsp'
> out.s:9: Error: bad register name `%rsp)'
> out.s:12: Error: invalid instruction suffix for `call'
> out.s:14: Error: bad register name `%rax'
> out.s:18: Error: bad register name `%rcx'
> out.s:22: Error: bad register name `%rcx)'
> out.s:23: Error: bad register name `%rsp,%rcx,4)'
> out.s:24: Error: bad register name `%rdx'
> out.s:29: Error: bad register name `%rax'
> out.s:36: Error: bad register name `%rsp,%rax,4)'
> out.s:39: Error: bad register name `%rsp)'
> out.s:42: Error: bad register name `%rsp)'
> out.s:44: Error: bad register name `%rsp)'
> out.s:45: Error: bad register name `%rsp'
> tomohiro at ubuntu:~$
> 
> 
> >>> In case this does not work, I will investigate this on an i386
> machine.
> >>> All our development machines are amd64 machines and I must admit we
> did
> >>> not test too much on i386. So issues on those machines are not too
> >>> unexpected. Though Raghesh runs i386. He may have seen such a
> problem
> >>> before.
> >>
> >> I see. I will try it amd64 version but now on VMWare.
> >> I'm glad if you tell me your environment in detail.
> >
> > Basically I have an Ubuntu amd64. So if you just want to go ahead
> with
> > some experiments I would us an 64bit operating system. Running Polly
> on
> > 64bit is possible (as raghesh did some work on this), but most
> probably
> > our implementation is not yet 100% bug free on 64bit.
> 
> Thanks. I'll try it.
> 
> > I just looked again at the lli test cases and they specifically
> contain
> > amd64 bit target triples. So most probably executing them on a 32bit
> > system will never work. If you want to stay with 32bit, I would try
> the
> > example on the webpage (from scratch) without using the pregenerated
> > LLVM-IR files. Let me know if/how this works.
> >
> > Cheers and thanks for your testing
> > Tobi
> >
> >
> 
> --
> Tomohiro
> moriyama at isit.or.jp
> 
> _______________________________________________
> LLVM Developers mailing list
> LLVMdev at cs.uiuc.edu         http://llvm.cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev








More information about the llvm-dev mailing list