Anton Korobeynikov
2007-Dec-16 17:11 UTC
[LLVMdev] Small patch for IntrinsicEmitter for VS
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.
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