Hi Matthias,
As you observed, eariy in julia's bootstrap you can't say
@inline function foo(args...)
statement1
...
but you can say
function foo(args...)
@_inline_meta
statement1
...
Best,
--Tim
On Thursday, June 23, 2016 2:33:32 AM CDT Matthias Reisinger wrote:
> Hi Tobias,
>
> thank you for the answer! After looking at jitlayers.cpp [1] it seems that
> Julia does not register LLVM's inlining pass. There only seems to exist
> explicit inlining in `emit_function` in codegen.cpp [2] and I'm not sure
> how this mechanism decides what to inline. I also naively tried to annotate
> `steprange_last` via with `@inline` in order to test the effects of
> inlining it but at this point in the base library `@inline` is not yet
> available. I therefore made a naive experiment by defining my own version
> of `steprange_last` to immitate the result of inlining it. To analyse this,
> I used the following function:
>
> @polly function foo(A)
> m,n = size(A)
> for i = 1:m
> start = 1
> step = 2
> last = my_inlined_steprange_last(1,2,n)
> j = start
> while j <= last
> A[i,j] = 0
> j += step
> end
> end
> end
>
> The code that is generated for this example should roughly correspond to
>
> @polly function foo(A)
> m,n = size(A)
> for i = 1:m, j = 1:2:n
> A[i,j] = 0
> end
> end
>
>
>
>
>
> @polly function init_array(A)
> m,n = size(A)
> for i = 1:m
> j = 1
> while j <= n
> A[i,j] = 0
> j += 2
> end
> end
> end
>
>
>
> [x]
https://github.com/JuliaLang/julia/blob/master/src/jitlayers.cpp
> [x]
https://github.com/JuliaLang/julia/blob/master/src/codegen.cpp#L4811
>
> On Wednesday, 22 June 2016 16:35:35 UTC+2, Tobias Grosser wrote: