@@ -4390,19 +4390,21 @@ fn emit_spec_driven_builtin(
43904390 }
43914391
43924392 // Build the typed SsaInstKind from the popped values.
4393- let ( inst_kind, out_info) = match kind {
4393+ let ( inst_kind, out_info, emitted_name ) = match kind {
43944394 SpecializedBuiltinKind :: StringLen => (
43954395 SsaInstKind :: StringLen {
43964396 text : popped[ 0 ] . value . id ,
43974397 } ,
43984398 ValueInfo :: int ( None ) ,
4399+ spec. name ,
43994400 ) ,
44004401 SpecializedBuiltinKind :: RegexMatch => (
44014402 SsaInstKind :: RegexMatch {
44024403 pattern : popped[ 1 ] . value . id ,
44034404 text : popped[ 0 ] . value . id ,
44044405 } ,
44054406 ValueInfo :: bool ( None ) ,
4407+ spec. name ,
44064408 ) ,
44074409 SpecializedBuiltinKind :: ArraySet => {
44084410 let value = & popped[ 0 ] ;
@@ -4432,7 +4434,11 @@ fn emit_spec_driven_builtin(
44324434 value : value. value . id ,
44334435 }
44344436 } ;
4435- ( ssa_kind, ValueInfo :: tagged_typed ( ValueType :: Array ) )
4437+ (
4438+ ssa_kind,
4439+ ValueInfo :: tagged_typed ( ValueType :: Array ) ,
4440+ if is_append { "array_push" } else { spec. name } ,
4441+ )
44364442 }
44374443 _ => unreachable ! ( "non-pilot builtin in spec-driven emit" ) ,
44384444 } ;
@@ -4445,16 +4451,7 @@ fn emit_spec_driven_builtin(
44454451 } )
44464452 . map_err ( |err| TraceRecordError :: InvalidIr ( err. to_string ( ) ) ) ?;
44474453
4448- let name = if matches ! ( kind, SpecializedBuiltinKind :: ArraySet )
4449- && matches ! (
4450- builder. defining_inst( out. value. id) . map( |inst| & inst. kind) ,
4451- Some ( SsaInstKind :: ArrayPush { .. } )
4452- ) {
4453- "array_push"
4454- } else {
4455- spec. name
4456- } ;
4457- Ok ( ( name, out) )
4454+ Ok ( ( emitted_name, out) )
44584455}
44594456
44604457fn ensure_entry_repr (
0 commit comments