[cfe-users] How to 'reloop' llvm code into ifs, whiles, fors?

2016-11-06 Thread Hugh Perkins via cfe-users
Hi, I have a project to rewrite llvm output as OpenCL, https://github.com/hughperkins/cuda-on-cl It currently contains lots of conditional branches, whch become /labels / gotos in the output OpenCL. What options are available to 'reloop' this to contain strictly ifs/fors/switches/breaks/whiles ?

Re: [cfe-users] What are the ll lines starting with '!0', '!1', etc? How to retrieve them?

2016-09-27 Thread Hugh Perkins via cfe-users
(Oh i see, the NamedMDNode contains MDNodes ) On Tue, Sep 27, 2016 at 3:22 PM, Hugh Perkins wrote: > In the IR text, I see lines like: > > !0 = !{void (float*)* @_Z11somekernel1Pf, !"kernel", i32 1} > !1 = !{void (float*)* @_Z3fooPf, !"kernel", i32 1} > > What are these? How to retrieve them, g

[cfe-users] What are the ll lines starting with '!0', '!1', etc? How to retrieve them?

2016-09-27 Thread Hugh Perkins via cfe-users
In the IR text, I see lines like: !0 = !{void (float*)* @_Z11somekernel1Pf, !"kernel", i32 1} !1 = !{void (float*)* @_Z3fooPf, !"kernel", i32 1} What are these? How to retrieve them, given eg a Module *. I've tried iterating over the global variables, named metadata, and aliases, but nothing.

[cfe-users] Question: is there a converter from IR to OpenCL?

2016-09-26 Thread Hugh Perkins via cfe-users
Question: is there a converter from IR to OpenCL? I know there are SPIR-V converters around. But SPIR-V is not very supported yet. IR written as OpenCL should probably be really ugly, but maybe useable-ish? ___ cfe-users mailing list cfe-users@lists.ll

Re: [cfe-users] How to emit device-side IR when compiling CUDA?

2016-09-26 Thread Hugh Perkins via cfe-users
( found it: --cuda-device-only cool :-) ) On Tue, Sep 27, 2016 at 12:17 AM, Hugh Perkins wrote: > I'm trying: > > clang++-3.8 -I/usr/local/cuda-7.5/include llvm-sample.cu -emit-llvm -S -o > llvm-sample.ll > > This seems to emit host-side IR only? > _

[cfe-users] How to emit device-side IR when compiling CUDA?

2016-09-26 Thread Hugh Perkins via cfe-users
I'm trying: clang++-3.8 -I/usr/local/cuda-7.5/include llvm-sample.cu -emit-llvm -S -o llvm-sample.ll This seems to emit host-side IR only? ___ cfe-users mailing list cfe-users@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-users