[PATCH] D92097: [RISCV] Basic jump table lowering

Nandor Licker via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Nov 26 07:14:10 PST 2020

nand marked an inline comment as not done.
nand added inline comments.

Comment at: llvm/lib/Target/RISCV/RISCVISelLowering.cpp:265
-  // Effectively disable jump table generation.
-  setMinimumJumpTableEntries(INT_MAX);
nand wrote:
> lenary wrote:
> > Let's make sure this doesn't have a major code size impact. I'm not sure the threshold GCC uses, something like 3 IIRC? 
> > 
> > The problem for code size is that the sequence to hold the jump table and the calculate the jump index is longer than a chain of ifs, if there aren't too many entries.
> I am using this backend to compile OCaml in a weird way. I could try to build a bunch of OCaml binaries with various thresholds, report the results and maybe we can make a decision for a reasonable default?
I now realised that I cannot change this threshold in my code generator, so I cannot provide any measurements.

Based on my understanding of the code,  unless the target explicitly overwrites it, the `-min-jump-table-entries` 
argument is used, which defaults to 4. If that is reasonable, maybe there is no point in hardcoding a default value?

  rG LLVM Github Monorepo



More information about the llvm-commits mailing list