File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -20,6 +20,11 @@ Working version
2020 [Flambda_middle_end]. Run [Un_anf] from the middle end, not [Cmmgen].
2121 (Mark Shinwell, review by Pierre Chambart)
2222
23+ ### Code generation and optimizations:
24+
25+ - #8672: Optimise Switch code generation on booleans.
26+ (Stephen Dolan, review by ??)
27+
2328### Runtime system:
2429
2530- #8619: Ensure Gc.minor_words remains accurate after a GC.
Original file line number Diff line number Diff line change @@ -186,6 +186,9 @@ let prerr_inter i = Printf.fprintf stderr
186186 and get_low cases i =
187187 let r,_,_ = cases.(i) in
188188 r
189+ and get_high cases i =
190+ let _,r,_ = cases.(i) in
191+ r
189192
190193 type ctests = {
191194 mutable n : int ;
@@ -659,9 +662,14 @@ let rec pkey chan = function
659662 and right = {s with cases= right} in
660663
661664 if i= 1 && (lim+ ctx.off)= 1 && get_low cases 0 + ctx.off= 0 then
662- make_if_ne
663- ctx.arg 0
664- (c_test ctx right) (c_test ctx left)
665+ if lcases = 2 && get_high cases 1 + ctx.off = 1 then
666+ Arg. make_if
667+ ctx.arg
668+ (c_test ctx right) (c_test ctx left)
669+ else
670+ make_if_ne
671+ ctx.arg 0
672+ (c_test ctx right) (c_test ctx left)
665673 else if less_tests cright cleft then
666674 make_if_lt
667675 ctx.arg (lim+ ctx.off)
You can’t perform that action at this time.
0 commit comments