[LLVMdev] Small patch for IntrinsicEmitter for VS

Anton Korobeynikov asl at math.spbu.ru
Sun Dec 16 09:11:56 PST 2007

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.

More information about the llvm-dev mailing list