Small patch for IntrinsicEmitter for VS

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|

Small patch for IntrinsicEmitter for VS

Cédric Venet-2
Hi,

The actual tableGen generate a chain of if/then/else for the intrinsic which
is too long for VS 2005, and result in a compile error. I did a small change
in table gen so that the if aren't chained so that I could compile (patch
attached). This double the algorithmic complexity of the function but it
seems that this wasn't a problem. If speed is needed here, we could hash the
string first in a few bin and do the if/then/else in each bin or use a
perfect hash or some hash container.

Regards,

Cédric

_______________________________________________
LLVM Developers mailing list
[hidden email]         http://llvm.cs.uiuc.edu
http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev

TableGenIntrinsic.patch (1K) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: Small patch for IntrinsicEmitter for VS

Anton Korobeynikov
Hello, Cedric

> seems that this wasn't a problem. If speed is needed here, we could hash the
> string first in a few bin and do the if/then/else in each bin or use a
> perfect hash or some hash container.
Thanks for the patch. However I have some better solution in the mind,
and it will land "really soon" (tm). We can do the the things much
better, if we will emit some sort of trie (or prefix tree, or search
tree, whatever) for the intrinsic names and walk over it to get the
result. Some code was already commited recently and more will follow.

This will allow us to have fast lookup (proportional to the intrinsic
length, not to the length of all intrinsics). As a side effect, the
amount of if clauses will something less than 20 in any case, which I
assume is perfectly ok for VCPP2005.
--
With best regards, Anton Korobeynikov.

Faculty of Mathematics & Mechanics, Saint Petersburg State University.


_______________________________________________
LLVM Developers mailing list
[hidden email]         http://llvm.cs.uiuc.edu
http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev
Reply | Threaded
Open this post in threaded view
|

Re: Small patch for IntrinsicEmitter for VS

Chris Lattner

On Dec 16, 2007, at 9:11 AM, Anton Korobeynikov wrote:

> Hello, Cedric
>
>> seems that this wasn't a problem. If speed is needed here, we could  
>> hash the
>> string first in a few bin and do the if/then/else in each bin or  
>> use a
>> perfect hash or some hash container.
> Thanks for the patch. However I have some better solution in the mind,
> and it will land "really soon" (tm). We can do the the things much
> better, if we will emit some sort of trie (or prefix tree, or search
> tree, whatever) for the intrinsic names and walk over it to get the
> result. Some code was already commited recently and more will follow.
>
> This will allow us to have fast lookup (proportional to the intrinsic
> length, not to the length of all intrinsics). As a side effect, the
> amount of if clauses will something less than 20 in any case, which I
> assume is perfectly ok for VCPP2005.

Anton, your patch definitely sounds like the right way to go, but  
should we apply this patch until its ready?

-Chris
_______________________________________________
LLVM Developers mailing list
[hidden email]         http://llvm.cs.uiuc.edu
http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev
Reply | Threaded
Open this post in threaded view
|

Re: Small patch for IntrinsicEmitter for VS

Anton Korobeynikov
In reply to this post by Anton Korobeynikov
Chris,

> Anton, your patch definitely sounds like the right way to go, but  
> should we apply this patch until its ready?
If I won't finish my bits today, I'll surely apply Cedric's patch.

--
With best regards, Anton Korobeynikov.

Faculty of Mathematics & Mechanics, Saint Petersburg State University.


_______________________________________________
LLVM Developers mailing list
[hidden email]         http://llvm.cs.uiuc.edu
http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev
Reply | Threaded
Open this post in threaded view
|

Re: Small patch for IntrinsicEmitter for VS

Chris Lattner

On Dec 16, 2007, at 1:18 PM, Anton Korobeynikov wrote:

> Chris,
>
>> Anton, your patch definitely sounds like the right way to go, but
>> should we apply this patch until its ready?
> If I won't finish my bits today, I'll surely apply Cedric's patch.

Ok, sounds great, thanks!

-Chris
_______________________________________________
LLVM Developers mailing list
[hidden email]         http://llvm.cs.uiuc.edu
http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev