https://gcc.gnu.org/bugzilla/show_bug.cgi?id=68837

HaoChen Gui <guihaoc at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |guihaoc at gcc dot gnu.org

--- Comment #2 from HaoChen Gui <guihaoc at gcc dot gnu.org> ---
(In reply to David Edelsohn from comment #0)
> Improve performance of switch statements:
> 
> 1) Heuristics for decision tree vs tablejump
> 
> 2) Avoid sign extended lwa for offset

I think #1 was already implemented in current GC. Jump tables coexists with
conditional jumps. jump-table-max-growth-ratio-for-speed/size decide how large
a jump table could be and case-values-threshold defines if a jump table is
beneficial. 

An example of GIMPLE switch
;; GIMPLE switch case clusters: 35 37 JT(values:5 comparisons:5 range:8
density: 62.50%):65-72 JT(values:6 comparisons:6 range:12 density:
50.00%):111-122

For #2, the offset could be negative in a multiple jump table case. Right now
it uses lwax and there is no overhead for sing extend, I think. Please correct
me if I am wrong.

Reply via email to