Thanks for your reply. I have a normal (../configure --enable-profiling --disable-optimized --enable-assertions) llvm debug+profile+assert build. I am generating llvm-bitcode using following commands. llvm-gcc -DLINUX_i386 -DSPEC_CPU2000 -O3 -emit-llvm 186.crafty/src/valid.c -c -o 186.crafty/src/valid.bc --- llvm-link 186.crafty/src/*.bc -o 186.crafty/186.crafty.rel.bc and finally: llc -march=arm 186.crafty/186.crafty.rel.bc -o 186.crafty/186.crafty.m5arm.s And there is not inline assembly in my C code. Should I somehow specify arm related options to llvm while building llvm? Thanks Daya On Tue, Jun 14, 2011 at 1:34 PM, Anton Korobeynikov <anton at korobeynikov.info> wrote:> Hello > > > Command => llc -march=arm 186.crafty/186.crafty.rel.bc -o > > 186.crafty/186.crafty.m5arm.s > > Error => LLVM ERROR: Couldn't allocate output reg for constraint '{cx}'! > > > > Have anyone seen this before? > It seems you're feeding x86-specific LLVM IR to arm backend. Please > don't do that. > > -- > With best regards, Anton Korobeynikov > Faculty of Mathematics and Mechanics, Saint Petersburg State University >-------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20110614/0af29cc4/attachment.html>
I believe you indeed need to specify some ARM-related things when buliding LLVM and LLVM-gcc (if you are compiling it from source). Below are the configurations I used, I believe. I may have tweaked them a bit, but this was the general idea: Configure llvm: ../llvm-2.9/configure --target=arm-none-linux-gnueabi --prefix=/home/grwright1/Research/llvm/llvm-install --with-llvmgccdir=/home/grwright1/Research/llvm/llvm-gcc --disable-multilib --disable-bootstrap --disable-optimized --enable-shared --enable-assertions --enable-languages=c,c++ Configure llvm-gcc: ../llvm-gcc-4.2-2.9.source/configure --target=arm-none-linux-gnueabi --program-prefix=llvm-arm- --prefix=/home/grwright1/Research/llvm/llvm-gcc/install -with-sysroot=/home/grwright1/Research/llvm/arm-2010q1/arm-none-linux-gnueabi/libc --with-gnu-ld=/home/grwright1/Research/llvm/arm-2010q1/bin/arm-none-linux-gnueabi-ld --with-gnu-as=/home/grwright1/Research/llvm/arm-2010q1/bin/arm-none-linux-gnueabi-as --with-gnu-ar=/home/grwright1/Research/llvm/arm-2010q1/bin/arm-none-linux-gnueabi-ar --enable-llvm=/home/grwright1/Research/llvm/llvm-obj --disable-optimized --disable-multilib --disable-bootstrap --disable-shared --enable-checking --enable-languages=c,c++ -Griffin On Tue, 14 Jun 2011 13:53:13 -0400, D S Khudia wrote: Thanks for your reply. I have a normal (../configure --enable-profiling --disable-optimized --enable-assertions) llvm debug+profile+assert build. I am generating llvm-bitcode using following commands. llvm-gcc -DLINUX_i386 -DSPEC_CPU2000 -O3 -emit-llvm 186.crafty/src/valid.c -c -o 186.crafty/src/valid.bc --- llvm-link 186.crafty/src/*.bc -o 186.crafty/186.crafty.rel.bc and finally: llc -march=arm 186.crafty/186.crafty.rel.bc -o 186.crafty/186.crafty.m5arm.s And there is not inline assembly in my C code. Should I somehow specify arm related options to llvm while building llvm? Thanks Daya On Tue, Jun 14, 2011 at 1:34 PM, Anton Korobeynikov wrote: Hello > Command => llc -march=arm 186.crafty/186.crafty.rel.bc -o > 186.crafty/186.crafty.m5arm.s > Error => LLVM ERROR: Couldn't allocate output reg for constraint '{cx}'! > > Have anyone seen this before? It seems you're feeding x86-specific LLVM IR to arm backend. Please don't do that. -- With best regards, Anton Korobeynikov Faculty of Mathematics and Mechanics, Saint Petersburg State University Links: ------ [1] mailto:anton at korobeynikov.info -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20110614/de2b452f/attachment.html>
-DLINUX_i386 seems like it might be including x86-specific assembly or intrinsics. Steve On Tue, Jun 14, 2011 at 10:53 AM, D S Khudia <daya.khudia at gmail.com> wrote:> Thanks for your reply. > > I have a normal (../configure --enable-profiling --disable-optimized > --enable-assertions) llvm debug+profile+assert build. > I am generating llvm-bitcode using following commands. > > llvm-gcc -DLINUX_i386 -DSPEC_CPU2000 -O3 -emit-llvm 186.crafty/src/valid.c > -c -o 186.crafty/src/valid.bc > --- > > llvm-link 186.crafty/src/*.bc -o 186.crafty/186.crafty.rel.bc > > and finally: > > llc -march=arm 186.crafty/186.crafty.rel.bc -o > 186.crafty/186.crafty.m5arm.s > > And there is not inline assembly in my C code. > > Should I somehow specify arm related options to llvm while building llvm? > > Thanks > Daya > > On Tue, Jun 14, 2011 at 1:34 PM, Anton Korobeynikov < > anton at korobeynikov.info> wrote: > >> Hello >> >> > Command => llc -march=arm 186.crafty/186.crafty.rel.bc -o >> > 186.crafty/186.crafty.m5arm.s >> > Error => LLVM ERROR: Couldn't allocate output reg for constraint >> '{cx}'! >> > >> > Have anyone seen this before? >> It seems you're feeding x86-specific LLVM IR to arm backend. Please >> don't do that. >> >> -- >> With best regards, Anton Korobeynikov >> Faculty of Mathematics and Mechanics, Saint Petersburg State University >> > > > _______________________________________________ > LLVM Developers mailing list > LLVMdev at cs.uiuc.edu http://llvm.cs.uiuc.edu > http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev > >-------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20110614/54a377d4/attachment.html>
Hi Daya,> And there is not inline assembly in my C code.there may well be in header files you include.> > Error => LLVM ERROR: Couldn't allocate output reg for constraint '{cx}'!This error message is complaining about inline assembler. Ciao, Duncan.
Thank you all for the inline assembly pointer. I have some macros (FD_ZERO, FD_SET) in benchmark code which comes from C library select (synchronous I/O multiplexing) and it does contain inline assembly. Is there a way the code containing such macros can work for ARM if compiled through llvm? Thanks Daya On Tue, Jun 14, 2011 at 3:02 PM, Duncan Sands <baldrick at free.fr> wrote:> Hi Daya, > > > And there is not inline assembly in my C code. > > there may well be in header files you include. > > > > Error => LLVM ERROR: Couldn't allocate output reg for constraint > '{cx}'! > > This error message is complaining about inline assembler. > > Ciao, Duncan. > _______________________________________________ > LLVM Developers mailing list > LLVMdev at cs.uiuc.edu http://llvm.cs.uiuc.edu > http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev >-------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20110614/ffcade46/attachment.html>