[llvm-dev] (RFC) JumpMaps: switch statement optimization

Joerg Sonnenberger via llvm-dev llvm-dev at lists.llvm.org
Mon Feb 13 16:40:15 PST 2017


On Mon, Feb 13, 2017 at 02:11:24PM +0100, Witold Waligora via llvm-dev wrote:
> JumpMaps: a generalization of JumpTables
> JumpTables produce fast and small code but have a limitation - they only
> work if case values are easy to compute from the variable being
> switch()ed. To overcome this limitation we introduce a {key,value}
> structure - a JumpMap.

We've been discussing supporting either perfect hashing or just a
pre-transformation a while ago. That would have a very similar use case,
the primary issue is the additional code for checking that the hashed
value is actually the expected value.

Joerg


More information about the llvm-dev mailing list