Previously, the generation of jumptables was disabled. This patch adds the necessary support, as reflected in the updated output in test/CodeGen/RISCV/jumptable.ll.
GCC using 5 as threshold to decide using jump table or not for RISC-V and LLVM using 4.
- Note: targetm.have_casesi () return false for RISC-V.
Alex, we have not yet merged this patch. We should merge it and we can leave the default as GCC.
This makes our code size gap with GCC smaller.
In the past I did see degradation in some SiFive hardware (I think it was on HiFive1 board). Maybe some of the SiFive colleagues can look at it at some point.