From a87aeef25b1641092a64a0a054740f60c6ac4602 Mon Sep 17 00:00:00 2001 From: Stephen Heumann Date: Tue, 20 Dec 2022 20:31:24 -0600 Subject: [PATCH] Ensure native peephole opt uses a jump table. In ORCA/Pascal's code generation, a case statement may use a jump table or a sequence of comparisons depending on whether it is considered sparse. This one was just a little too sparse to use a jump table, but changing it to use one makes it considerably faster. To force generation of a jump table, this commit adds several more explicit cases (even though they don't do anything). --- Native.pas | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Native.pas b/Native.pas index 4fada0d..08c2f88 100644 --- a/Native.pas +++ b/Native.pas @@ -2013,6 +2013,8 @@ var Remove(ns+2); end; {if} + {extra explicit cases to ensure this case statement uses a jump table} + m_rtl,m_rts,m_jml,m_jsl,m_mvn,m_plp,m_pld,m_txs, otherwise: ; end; {case}