[llvm-dev] SimplifyCFG's switch to lookup table with illegal types.

Craig Topper via llvm-dev llvm-dev at lists.llvm.org
Fri Jul 30 08:56:20 PDT 2021


ShouldBuildLookupTable contains a check to make sure the type of the Phi is
legal for the target. This currently prevents i32 lookup tables from being
formed on RISCV64 which only has i64 as a legal type. Obviously i32 is
going to be a more widespread type than i64 for C code so I would like to
improve this. But i8/i16 are also disabled on RISCV, ARM, AArch64, and
probably other targets which can do an i8/i16 load.

What is the right check here? Can we make sure it fits in the largest
native integer type from data layout instead? Or should we add another TTI
hook to ask the target?

Thanks,
~Craig
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20210730/415e0b91/attachment.html>


More information about the llvm-dev mailing list