[Mono-dev] Mono generates inefficient vectorized code

Rodrigo Kumpera kumpera at gmail.com
Thu Mar 11 19:35:20 EST 2010


Finish, test and optimize it. And port to 32bits systems. It it a huge
amount of work.


On Thu, Mar 11, 2010 at 9:29 PM, Jerry Maine - KF5ADY <crashfourit at gmail.com
> wrote:

>  And what needs to be done to get the global allocator to work?
>
> Rodrigo Kumpera wrote:
>
> Hi Sergei,
>
> On Thu, Mar 11, 2010 at 8:30 PM, Sergei Dyshel <qyron.private at gmail.com>wrote:
>
>> Hello,
>> I'm doing some research on vectorization using Mono. I've noticed that
>> code generated by Mono's JIT contains many unnecessary memory loads
>> and stores. Here is simple example, the full code is attached:
>>
>> public static unsafe int sum(int* a, int size) {
>>  Vector4i temp = new Vector4i();
>>  Vector4i* p = (Vector4i*) a;
>>  for (int i = 0; i < size/4; i++) {
>>    temp += *p;
>>    p += 1;
>>  }
>>  return temp.X + temp.Y + temp.Z + temp.W;
>> }
>>
>>
>
>  The problem you're seen of going to memory when not needed is due to the
> fact that
> mono lacks a working global register allocator. If you use a value in a
> single basic block,
> you'll notice that it's kept in memory the whole time.
>
> We don't eliminate a lot of redundancies, even under SSA, because our JIT
> doesn't know how
> to handle SIMD ops under that form. It's an open problem requiring some
> work. The same
> applies to our global register allocator.
>
> ------------------------------
>
> _______________________________________________
> Mono-devel-list mailing listMono-devel-list at lists.ximian.comhttp://lists.ximian.com/mailman/listinfo/mono-devel-list
>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.ximian.com/pipermail/mono-devel-list/attachments/20100311/64a8ab55/attachment.html 


More information about the Mono-devel-list mailing list