[llvm-commits] [LLVM, SwitchInst, case ranges] Auxiliary patch #1
Stepan Dyatkovskiy
STPWORLD at narod.ru
Fri Oct 28 05:38:07 PDT 2011
Hi, Duncan.
Well, on instruction selection level switch cases are already grouped to switch ranges. I don't think that case ranges increases complexity of existing optimizers. I think that its useful when we work with front-ends like Fortran, since we doesn't need to split fortran's case-ranges and combine them again during switch lowering procedure.
-Stepan
28.10.2011, 16:19, "Duncan Sands" <baldrick at free.fr>:
> Hi Stepan, I have to ask: what are switch case ranges good for? Will they
> actually result in better code, or just more complexity in the optimizers
> and code generators? Sorry to ask at this late date. I know I'm the one
> that first suggested adding case ranges, but I've since come to wonder
> whether they are really useful.
>
> Ciao, Duncan.
>
>> Hi all. The main discussion branch of this feature is here:
>> http://llvm.org/bugs/show_bug.cgi?id=1255
>>
>> We need change SwitchInst internals: replace case value type from "ConstantInt"
>> to "APInt", then move case values out from operands collection. To do that we
>> need add APInt::isInitialized feature. We also need extend SmallSet class adding
>> Compare parameter to this template:
>> template <typename T, unsigned N, typename C = std::less<T> >
>>
>> Please find attached patches for review.
>>
>> Regards,
>> Stepan.
>>
>> _______________________________________________
>> llvm-commits mailing list
>> llvm-commits at cs.uiuc.edu
>> http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
>
> _______________________________________________
> llvm-commits mailing list
> llvm-commits at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
More information about the llvm-commits
mailing list