Thanks, is it possible for julia to avoid generating jl_value_t

When I use a scalar Int64 julia generates code with i64 as input and no 
 jl_value_t appears. is it possible to do the same with arrays? 
 Array{Float32,2} genrates a  jl_value_t? Is there an array type that can 
do this? For example fixed arrays?

Finally, is this features planned to be supported if julia statically 
compiles?

Thanks

On Tuesday, October 25, 2016 at 9:23:02 AM UTC-7, Yichao Yu wrote:
>
> On Mon, Oct 24, 2016 at 8:15 PM,  <icebl...@gmail.com <javascript:>> 
> wrote: 
> > Hi All, 
> > 
> > I am trying to call llvm ir generated from julia. 
> > 
> > Here is my function: 
> > 
> > function incr(a::Array{Int64})  a+1; end 
> > 
> > 
> > thus: 
> > 
> > @code_llvm(incr([1 2 5 6 7])) 
> > 
> > returns: 
> > 
> > define %jl_value_t* @julia_incr_62127(%jl_value_t*) #0 { 
> > top: 
> >   %1 = call %jl_value_t* @"julia_.+_62128"(%jl_value_t* %0, i64 1) #0 
> >   ret %jl_value_t* %1 
> > } 
> > 
> > 
> > 
> > Thus to call it using llvm I try : 
> > 
> > Base.llvmcall(("""declare %jl_value_t* 
> @julia_incr_62127(%jl_value_t*)""", 
> > """top: 
> >          %1 = call %jl_value_t* @"julia_.+_62128"(%jl_value_t* %0, i64 
> 1) #0 
> >          ret %jl_value_t* %1 
> >        """),Vector{Int64},Tuple{Array{Int64}},[1 2 5 6 7]) 
> > 
> > 
> > 
> > 
> > and I get the error: 
> > 
> > ERROR: error compiling anonymous: Failed to parse LLVM Assembly: 
> > julia: llvmcall:2:9: error: use of undefined type named 'jl_value_t' 
> > declare %jl_value_t* @julia_incr_62127(%jl_value_t*) 
> > 
> > 
> > I m not sure how to define jl_value_t. 
>
> This is not supported. 
> You also shouldn't call julia generated functions with `llvmcall`. 
>
> > 
> > 
> > any help? 
> > 
> > Thanks 
>

Reply via email to