nkavv at physics.auth.gr
2013-Feb-04 18:09 UTC
[LLVMdev] Problem with PTX assembly printing (NVPTX backend)
Hi Justin,>> Has anyone had similar problems with the NVPTX backend? Shouldn't this >> code be linked to the AsmPrinter library for NVPTX (already)? > > What do you mean by "doesn't work"? The AsmPrinter library really houses > the MCInst printer, which isn't implemented for NVPTX yet. The older > assembly printer works just fine. This is transparent to users. The NVPTX > target can be used just like MIPS and X86 with llc (and library users). > > Is llc saying nvptx is an invalid target? If so, you probably built LLVM > without NVPTX.I've used -enable-targets=all, and all libLLVMNVPTX*.a libs were produced. However, the AsmPrinter one looks dummy. Further, nvptx appears as a registered target when running llc --version. llc doesn't complain, but just "runs" forever with apparently no output>> BTW I've built LLVM with mingw (strange mixture of gcc-3.4.5 and >> g++-4.6.1). Native compilation, MIPS backend and other things that i've >> tested, all work properly. > > Perhaps this "strange mixture" is causing some symbol errors somewhere. > Can you post the exact sequence of steps you used to build LLVM, along with > the llc command-line that fails for you?My configuration options were: --prefix=/my/local/path/or/so --enable-shared --enable-targets=all --enable-optimized --disable-libffi --disable-debug-runtime --disable-assertions --disable-expensive-checks Following configuration i did the typical make and make install (to a selected path by --prefix. Best regards Nikolaos Kavvadias> > >> >> Any help is appreciated. >> >> Best regards, >> Nikolaos Kavvadias >> >> >> >> ______________________________**_________________ >> LLVM Developers mailing list >> LLVMdev at cs.uiuc.edu http://llvm.cs.uiuc.edu >> http://lists.cs.uiuc.edu/**mailman/listinfo/llvmdev<http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev> >> > > > > -- > > Thanks, > > Justin Holewinski >
Justin Holewinski
2013-Feb-04 18:10 UTC
[LLVMdev] Problem with PTX assembly printing (NVPTX backend)
On Mon, Feb 4, 2013 at 1:09 PM, <nkavv at physics.auth.gr> wrote:> Hi Justin, > > > Has anyone had similar problems with the NVPTX backend? Shouldn't this >>> code be linked to the AsmPrinter library for NVPTX (already)? >>> >> >> What do you mean by "doesn't work"? The AsmPrinter library really houses >> the MCInst printer, which isn't implemented for NVPTX yet. The older >> assembly printer works just fine. This is transparent to users. The >> NVPTX >> target can be used just like MIPS and X86 with llc (and library users). >> >> Is llc saying nvptx is an invalid target? If so, you probably built LLVM >> without NVPTX. >> > > I've used -enable-targets=all, and all libLLVMNVPTX*.a libs were produced. > However, the AsmPrinter one looks dummy. > > Further, nvptx appears as a registered target when running llc --version. > > llc doesn't complain, but just "runs" forever with apparently no outputCan you post the llc command line you're using? Can you post an LLVM IR file that causes this behavior?> > > BTW I've built LLVM with mingw (strange mixture of gcc-3.4.5 and >>> g++-4.6.1). Native compilation, MIPS backend and other things that i've >>> tested, all work properly. >>> >> >> Perhaps this "strange mixture" is causing some symbol errors somewhere. >> Can you post the exact sequence of steps you used to build LLVM, along >> with >> the llc command-line that fails for you? >> > > My configuration options were: > > --prefix=/my/local/path/or/so --enable-shared --enable-targets=all > --enable-optimized --disable-libffi --disable-debug-runtime > --disable-assertions --disable-expensive-checks > > Following configuration i did the typical make and make install (to a > selected path by --prefix. > > > Best regards > Nikolaos Kavvadias > > > >> >> >>> Any help is appreciated. >>> >>> Best regards, >>> Nikolaos Kavvadias >>> >>> >>> >>> ______________________________****_________________ >>> >>> LLVM Developers mailing list >>> LLVMdev at cs.uiuc.edu http://llvm.cs.uiuc.edu >>> http://lists.cs.uiuc.edu/****mailman/listinfo/llvmdev<http://lists.cs.uiuc.edu/**mailman/listinfo/llvmdev> >>> <http:**//lists.cs.uiuc.edu/mailman/**listinfo/llvmdev<http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev> >>> > >>> >>> >> >> >> -- >> >> Thanks, >> >> Justin Holewinski >> >> > > >-- Thanks, Justin Holewinski -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20130204/cc47493c/attachment.html>
ankur deshwal
2013-Feb-04 18:52 UTC
[LLVMdev] Problem with PTX assembly printing (NVPTX backend)
Hi Nikolaos, Following commands work great for me. $ clang -S -emit-llvm -target nvptx -x cl -include clc/clctypes.h ../data-types/scalar.cl $ llc -mcpu=sm_30 scalar.s You can follow Justin's blog [1]. It helped me a lot to understand where to start. [1] http://jholewinski.org/blog/llvm-3-0-ptx-backend/ Best, Ankur On Mon, Feb 4, 2013 at 11:40 PM, Justin Holewinski < justin.holewinski at gmail.com> wrote:> On Mon, Feb 4, 2013 at 1:09 PM, <nkavv at physics.auth.gr> wrote: > >> Hi Justin, >> >> >> Has anyone had similar problems with the NVPTX backend? Shouldn't this >>>> code be linked to the AsmPrinter library for NVPTX (already)? >>>> >>> >>> What do you mean by "doesn't work"? The AsmPrinter library really houses >>> the MCInst printer, which isn't implemented for NVPTX yet. The older >>> assembly printer works just fine. This is transparent to users. The >>> NVPTX >>> target can be used just like MIPS and X86 with llc (and library users). >>> >>> Is llc saying nvptx is an invalid target? If so, you probably built LLVM >>> without NVPTX. >>> >> >> I've used -enable-targets=all, and all libLLVMNVPTX*.a libs were >> produced. However, the AsmPrinter one looks dummy. >> >> Further, nvptx appears as a registered target when running llc --version. >> >> llc doesn't complain, but just "runs" forever with apparently no output > > > Can you post the llc command line you're using? Can you post an LLVM IR > file that causes this behavior? > > >> >> >> BTW I've built LLVM with mingw (strange mixture of gcc-3.4.5 and >>>> g++-4.6.1). Native compilation, MIPS backend and other things that i've >>>> tested, all work properly. >>>> >>> >>> Perhaps this "strange mixture" is causing some symbol errors somewhere. >>> Can you post the exact sequence of steps you used to build LLVM, along >>> with >>> the llc command-line that fails for you? >>> >> >> My configuration options were: >> >> --prefix=/my/local/path/or/so --enable-shared --enable-targets=all >> --enable-optimized --disable-libffi --disable-debug-runtime >> --disable-assertions --disable-expensive-checks >> >> Following configuration i did the typical make and make install (to a >> selected path by --prefix. >> >> >> Best regards >> Nikolaos Kavvadias >> >> >> >>> >>> >>>> Any help is appreciated. >>>> >>>> Best regards, >>>> Nikolaos Kavvadias >>>> >>>> >>>> >>>> ______________________________****_________________ >>>> >>>> LLVM Developers mailing list >>>> LLVMdev at cs.uiuc.edu http://llvm.cs.uiuc.edu >>>> http://lists.cs.uiuc.edu/****mailman/listinfo/llvmdev<http://lists.cs.uiuc.edu/**mailman/listinfo/llvmdev> >>>> <http:**//lists.cs.uiuc.edu/mailman/**listinfo/llvmdev<http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev> >>>> > >>>> >>>> >>> >>> >>> -- >>> >>> Thanks, >>> >>> Justin Holewinski >>> >>> >> >> >> > > > -- > > Thanks, > > Justin Holewinski > > _______________________________________________ > 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/20130205/278b9f97/attachment.html>
nkavv at physics.auth.gr
2013-Feb-04 19:04 UTC
[LLVMdev] Problem with PTX assembly printing (NVPTX backend)
Hi,> Can you post the llc command line you're using? Can you post an LLVM IR > file that causes this behavior?yes: ${LLVM_PATH}/bin/llc -o helloworld.s -march=nvptx helloworld.ll where LLVM_PATH my local installation path for LLVM. Also attaching helloworld.c: #include <stdio.h> int main(void) { printf("Hello World!\n"); return 0; } and helloworld.ll: ; ModuleID = 'helloworld.c' target datalayout = "e-p:32:32:32-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f32:32:32-f64:64:64-f80:128:128-v64:64:64-v128:128:128-a0:0:64-f80:32:32-n8:16:32-S32" target triple = "i686-w64-mingw32" @str = private unnamed_addr constant [13 x i8] c"Hello World!\00" define i32 @main() nounwind { %puts = tail call i32 @puts(i8* getelementptr inbounds ([13 x i8]* @str, i32 0, i32 0)) ret i32 0 } declare i32 @puts(i8* nocapture) nounwind For instance, the "mips" target produces this: .section .mdebug.abi32 .previous .file "helloworld.ll" .text .globl main .align 2 .type main, at function .set nomips16 # @main .ent main main: .frame $sp,24,$ra .mask 0x80000000,-4 .fmask 0x00000000,0 .set noreorder .set nomacro .set noat # BB#0: lui $2, %hi(_gp_disp) addiu $2, $2, %lo(_gp_disp) addiu $sp, $sp, -24 sw $ra, 20($sp) # 4-byte Folded Spill addu $gp, $2, $25 lw $1, %got($str)($gp) lw $25, %call16(puts)($gp) jalr $25 addiu $4, $1, %lo($str) addiu $2, $zero, 0 lw $ra, 20($sp) # 4-byte Folded Reload jr $ra addiu $sp, $sp, 24 .set at .set macro .set reorder .end main $tmp2: .size main, ($tmp2)-main .type $str, at object # @str .section .rodata.str1.4,"aMS", at progbits,1 .align 2 $str: .asciz "Hello World!" .size $str, 13 Best regards Nikolaos Kavvadias>> BTW I've built LLVM with mingw (strange mixture of gcc-3.4.5 and >>>> g++-4.6.1). Native compilation, MIPS backend and other things that i've >>>> tested, all work properly. >>>> >>> >>> Perhaps this "strange mixture" is causing some symbol errors somewhere. >>> Can you post the exact sequence of steps you used to build LLVM, along >>> with >>> the llc command-line that fails for you? >>> >> >> My configuration options were: >> >> --prefix=/my/local/path/or/so --enable-shared --enable-targets=all >> --enable-optimized --disable-libffi --disable-debug-runtime >> --disable-assertions --disable-expensive-checks >> >> Following configuration i did the typical make and make install (to a >> selected path by --prefix. >> >> >> Best regards >> Nikolaos Kavvadias >> >> >> >>> >>> >>>> Any help is appreciated. >>>> >>>> Best regards, >>>> Nikolaos Kavvadias >>>> >>>> >>>> >>>> ______________________________****_________________ >>>> >>>> LLVM Developers mailing list >>>> LLVMdev at cs.uiuc.edu http://llvm.cs.uiuc.edu >>>> http://lists.cs.uiuc.edu/****mailman/listinfo/llvmdev<http://lists.cs.uiuc.edu/**mailman/listinfo/llvmdev> >>>> <http:**//lists.cs.uiuc.edu/mailman/**listinfo/llvmdev<http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev> >>>> > >>>> >>>> >>> >>> >>> -- >>> >>> Thanks, >>> >>> Justin Holewinski >>> >>> >> >> >> > > > -- > > Thanks, > > Justin Holewinski >
Possibly Parallel Threads
- [LLVMdev] Problem with PTX assembly printing (NVPTX backend)
- [LLVMdev] Problem with PTX assembly printing (NVPTX backend)
- [LLVMdev] Problem with PTX assembly printing (NVPTX backend)
- [LLVMdev] Problem with PTX assembly printing (NVPTX backend)
- [LLVMdev] Problem with PTX assembly printing (NVPTX backend)