@@ -546,26 +546,29 @@ module Compiler_pass = struct
546546 - the manpages in man/ocaml{c,opt}.m
547547 - the manual manual/manual/cmds/unified-options.etex
548548 *)
549- type t = Parsing | Typing | Scheduling | Emit | Simplify_cfg
549+ type t = Parsing | Typing | Scheduling | Emit | Simplify_cfg | Selection
550550
551551 let to_string = function
552552 | Parsing -> " parsing"
553553 | Typing -> " typing"
554554 | Scheduling -> " scheduling"
555555 | Emit -> " emit"
556556 | Simplify_cfg -> " simplify_cfg"
557+ | Selection -> " selection"
557558
558559 let of_string = function
559560 | "parsing" -> Some Parsing
560561 | "typing" -> Some Typing
561562 | "scheduling" -> Some Scheduling
562563 | "emit" -> Some Emit
563564 | "simplify_cfg" -> Some Simplify_cfg
565+ | "selection" -> Some Selection
564566 | _ -> None
565567
566568 let rank = function
567569 | Parsing -> 0
568570 | Typing -> 1
571+ | Selection -> 20
569572 | Simplify_cfg -> 49
570573 | Scheduling -> 50
571574 | Emit -> 60
@@ -576,19 +579,22 @@ module Compiler_pass = struct
576579 Scheduling ;
577580 Emit ;
578581 Simplify_cfg ;
582+ Selection ;
579583 ]
580584 let is_compilation_pass _ = true
581585 let is_native_only = function
582586 | Scheduling -> true
583587 | Emit -> true
584588 | Simplify_cfg -> true
589+ | Selection -> true
585590 | Parsing | Typing -> false
586591
587592 let enabled is_native t = not (is_native_only t) || is_native
588593 let can_save_ir_after = function
589594 | Scheduling -> true
590595 | Simplify_cfg -> true
591- | _ -> false
596+ | Selection -> true
597+ | Parsing | Typing | Emit -> false
592598
593599 let available_pass_names ~filter ~native =
594600 passes
@@ -603,6 +609,7 @@ module Compiler_pass = struct
603609 match t with
604610 | Scheduling -> prefix ^ Compiler_ir. (extension Linear )
605611 | Simplify_cfg -> prefix ^ Compiler_ir. (extension Cfg )
612+ | Selection -> prefix ^ Compiler_ir. (extension Cfg ) ^ " -sel"
606613 | Emit | Parsing | Typing -> Misc. fatal_error " Not supported"
607614
608615 let of_input_filename name =
0 commit comments