[llvm-commits] [Patch] Replace switches with lookup tables (PR884)

Hans Wennborg hans at chromium.org
Mon Sep 10 01:31:36 PDT 2012


On Sun, Sep 9, 2012 at 6:46 AM, Duncan Sands <baldrick at free.fr> wrote:
>> Thanks for doing this. I also agree this seems like a very valuable
>> optimization.
>>
>> However, I'm slightly concerned with "where" this is done. I can think of
>> exotic targets where a lookup table is infeasible (e.g. certain GPUs?) So
>> this falls in the category of optimizations that need target information. In
>> that case, we would be better off doing this late, i.e. codegenprep.
>
> can't such targets turn it back into a switch?  An advantage of doing it at
> the
> IR level is the knock-on effect of enabling other IR optimizations to kick
> in.

It seems this discussion ended up in two different threads. I've
replied on the other thread ([llvm-commits] [llvm] r163302 - in
/llvm/trunk ...)

Thanks,
Hans



More information about the llvm-commits mailing list