brintos

brintos / llvm-project-archived public Read only

0
0
Text · 17.7 KiB · cd9f08a Raw
372 lines · plain
1/* Original C (for context):2* // Declare a real external call so the compiler must respect ABI clobbers.3* extern int leaf(int) __attribute__((noinline));4* 5* __attribute__((noinline))6* int live_across_call(int x) {7*   volatile int a = x;                // a starts in a GPR (from arg)8*   asm volatile("" :: "r"(a));        // keep 'a' live in a register9*   int r = leaf(a);                   // 'a' is live across the call10*   asm volatile("" :: "r"(a), "r"(r));// still live afterwards11*   return a + r;12* }13*/14	.file	"live_across_call.c"15	.text16	.globl	live_across_call                # -- Begin function live_across_call17	.p2align	418	.type	live_across_call,@function19live_across_call:                       # @live_across_call20.Lfunc_begin0:21	.file	0 "." "live_across_call.c" md5 0x351c37295026edf0d468774d35f47e5e22	.loc	0 5 0                           # live_across_call.c:5:023	.cfi_startproc24# %bb.0:                                # %entry25	#DEBUG_VALUE: live_across_call:x <- $edi26	pushq	%rbp27	.cfi_def_cfa_offset 1628	.cfi_offset %rbp, -1629	movq	%rsp, %rbp30	.cfi_def_cfa_register %rbp31	subq	$16, %rsp32.Ltmp0:33	.loc	0 6 16 prologue_end             # live_across_call.c:6:1634	movl	%edi, -4(%rbp)35	.loc	0 7 26                          # live_across_call.c:7:2636	movl	-4(%rbp), %eax37	.loc	0 7 3 is_stmt 0                 # live_across_call.c:7:338	#APP39	#NO_APP40	.loc	0 8 16 is_stmt 1                # live_across_call.c:8:1641	movl	-4(%rbp), %edi42.Ltmp1:43	#DEBUG_VALUE: live_across_call:x <- [DW_OP_LLVM_entry_value 1] $edi44	.loc	0 8 11 is_stmt 0                # live_across_call.c:8:1145	callq	leaf@PLT46.Ltmp2:47	#DEBUG_VALUE: live_across_call:r <- $eax48	.loc	0 9 26 is_stmt 1                # live_across_call.c:9:2649	movl	-4(%rbp), %ecx50	.loc	0 9 3 is_stmt 0                 # live_across_call.c:9:351	#APP52	#NO_APP53	.loc	0 10 12 is_stmt 1               # live_across_call.c:10:1254	addl	-4(%rbp), %eax55.Ltmp3:56	.loc	0 10 3 epilogue_begin is_stmt 0 # live_across_call.c:10:357	addq	$16, %rsp58	popq	%rbp59	.cfi_def_cfa %rsp, 860	retq61.Ltmp4:62.Lfunc_end0:63	.size	live_across_call, .Lfunc_end0-live_across_call64	.cfi_endproc65                                        # -- End function66	.section	.debug_loclists,"",@progbits67	.long	.Ldebug_list_header_end0-.Ldebug_list_header_start0 # Length68.Ldebug_list_header_start0:69	.short	5                               # Version70	.byte	8                               # Address size71	.byte	0                               # Segment selector size72	.long	2                               # Offset entry count73.Lloclists_table_base0:74	.long	.Ldebug_loc0-.Lloclists_table_base075	.long	.Ldebug_loc1-.Lloclists_table_base076.Ldebug_loc0:77	.byte	4                               # DW_LLE_offset_pair78	.uleb128 .Lfunc_begin0-.Lfunc_begin0    #   starting offset79	.uleb128 .Ltmp1-.Lfunc_begin0           #   ending offset80	.byte	1                               # Loc expr size81	.byte	85                              # super-register DW_OP_reg582	.byte	4                               # DW_LLE_offset_pair83	.uleb128 .Ltmp1-.Lfunc_begin0           #   starting offset84	.uleb128 .Lfunc_end0-.Lfunc_begin0      #   ending offset85	.byte	4                               # Loc expr size86	.byte	163                             # DW_OP_entry_value87	.byte	1                               # 188	.byte	85                              # super-register DW_OP_reg589	.byte	159                             # DW_OP_stack_value90	.byte	0                               # DW_LLE_end_of_list91.Ldebug_loc1:92	.byte	4                               # DW_LLE_offset_pair93	.uleb128 .Ltmp2-.Lfunc_begin0           #   starting offset94	.uleb128 .Ltmp3-.Lfunc_begin0           #   ending offset95	.byte	1                               # Loc expr size96	.byte	80                              # super-register DW_OP_reg097	.byte	0                               # DW_LLE_end_of_list98.Ldebug_list_header_end0:99	.section	.debug_abbrev,"",@progbits100	.byte	1                               # Abbreviation Code101	.byte	17                              # DW_TAG_compile_unit102	.byte	1                               # DW_CHILDREN_yes103	.byte	37                              # DW_AT_producer104	.byte	37                              # DW_FORM_strx1105	.byte	19                              # DW_AT_language106	.byte	5                               # DW_FORM_data2107	.byte	3                               # DW_AT_name108	.byte	37                              # DW_FORM_strx1109	.byte	114                             # DW_AT_str_offsets_base110	.byte	23                              # DW_FORM_sec_offset111	.byte	16                              # DW_AT_stmt_list112	.byte	23                              # DW_FORM_sec_offset113	.byte	27                              # DW_AT_comp_dir114	.byte	37                              # DW_FORM_strx1115	.byte	17                              # DW_AT_low_pc116	.byte	27                              # DW_FORM_addrx117	.byte	18                              # DW_AT_high_pc118	.byte	6                               # DW_FORM_data4119	.byte	115                             # DW_AT_addr_base120	.byte	23                              # DW_FORM_sec_offset121	.ascii	"\214\001"                      # DW_AT_loclists_base122	.byte	23                              # DW_FORM_sec_offset123	.byte	0                               # EOM(1)124	.byte	0                               # EOM(2)125	.byte	2                               # Abbreviation Code126	.byte	46                              # DW_TAG_subprogram127	.byte	1                               # DW_CHILDREN_yes128	.byte	17                              # DW_AT_low_pc129	.byte	27                              # DW_FORM_addrx130	.byte	18                              # DW_AT_high_pc131	.byte	6                               # DW_FORM_data4132	.byte	64                              # DW_AT_frame_base133	.byte	24                              # DW_FORM_exprloc134	.byte	122                             # DW_AT_call_all_calls135	.byte	25                              # DW_FORM_flag_present136	.byte	3                               # DW_AT_name137	.byte	37                              # DW_FORM_strx1138	.byte	58                              # DW_AT_decl_file139	.byte	11                              # DW_FORM_data1140	.byte	59                              # DW_AT_decl_line141	.byte	11                              # DW_FORM_data1142	.byte	39                              # DW_AT_prototyped143	.byte	25                              # DW_FORM_flag_present144	.byte	73                              # DW_AT_type145	.byte	19                              # DW_FORM_ref4146	.byte	63                              # DW_AT_external147	.byte	25                              # DW_FORM_flag_present148	.byte	0                               # EOM(1)149	.byte	0                               # EOM(2)150	.byte	3                               # Abbreviation Code151	.byte	5                               # DW_TAG_formal_parameter152	.byte	0                               # DW_CHILDREN_no153	.byte	2                               # DW_AT_location154	.byte	34                              # DW_FORM_loclistx155	.byte	3                               # DW_AT_name156	.byte	37                              # DW_FORM_strx1157	.byte	58                              # DW_AT_decl_file158	.byte	11                              # DW_FORM_data1159	.byte	59                              # DW_AT_decl_line160	.byte	11                              # DW_FORM_data1161	.byte	73                              # DW_AT_type162	.byte	19                              # DW_FORM_ref4163	.byte	0                               # EOM(1)164	.byte	0                               # EOM(2)165	.byte	4                               # Abbreviation Code166	.byte	52                              # DW_TAG_variable167	.byte	0                               # DW_CHILDREN_no168	.byte	2                               # DW_AT_location169	.byte	24                              # DW_FORM_exprloc170	.byte	3                               # DW_AT_name171	.byte	37                              # DW_FORM_strx1172	.byte	58                              # DW_AT_decl_file173	.byte	11                              # DW_FORM_data1174	.byte	59                              # DW_AT_decl_line175	.byte	11                              # DW_FORM_data1176	.byte	73                              # DW_AT_type177	.byte	19                              # DW_FORM_ref4178	.byte	0                               # EOM(1)179	.byte	0                               # EOM(2)180	.byte	5                               # Abbreviation Code181	.byte	52                              # DW_TAG_variable182	.byte	0                               # DW_CHILDREN_no183	.byte	2                               # DW_AT_location184	.byte	34                              # DW_FORM_loclistx185	.byte	3                               # DW_AT_name186	.byte	37                              # DW_FORM_strx1187	.byte	58                              # DW_AT_decl_file188	.byte	11                              # DW_FORM_data1189	.byte	59                              # DW_AT_decl_line190	.byte	11                              # DW_FORM_data1191	.byte	73                              # DW_AT_type192	.byte	19                              # DW_FORM_ref4193	.byte	0                               # EOM(1)194	.byte	0                               # EOM(2)195	.byte	6                               # Abbreviation Code196	.byte	72                              # DW_TAG_call_site197	.byte	0                               # DW_CHILDREN_no198	.byte	127                             # DW_AT_call_origin199	.byte	19                              # DW_FORM_ref4200	.byte	125                             # DW_AT_call_return_pc201	.byte	27                              # DW_FORM_addrx202	.byte	0                               # EOM(1)203	.byte	0                               # EOM(2)204	.byte	7                               # Abbreviation Code205	.byte	46                              # DW_TAG_subprogram206	.byte	1                               # DW_CHILDREN_yes207	.byte	3                               # DW_AT_name208	.byte	37                              # DW_FORM_strx1209	.byte	58                              # DW_AT_decl_file210	.byte	11                              # DW_FORM_data1211	.byte	59                              # DW_AT_decl_line212	.byte	11                              # DW_FORM_data1213	.byte	39                              # DW_AT_prototyped214	.byte	25                              # DW_FORM_flag_present215	.byte	73                              # DW_AT_type216	.byte	19                              # DW_FORM_ref4217	.byte	60                              # DW_AT_declaration218	.byte	25                              # DW_FORM_flag_present219	.byte	63                              # DW_AT_external220	.byte	25                              # DW_FORM_flag_present221	.byte	0                               # EOM(1)222	.byte	0                               # EOM(2)223	.byte	8                               # Abbreviation Code224	.byte	5                               # DW_TAG_formal_parameter225	.byte	0                               # DW_CHILDREN_no226	.byte	73                              # DW_AT_type227	.byte	19                              # DW_FORM_ref4228	.byte	0                               # EOM(1)229	.byte	0                               # EOM(2)230	.byte	9                               # Abbreviation Code231	.byte	36                              # DW_TAG_base_type232	.byte	0                               # DW_CHILDREN_no233	.byte	3                               # DW_AT_name234	.byte	37                              # DW_FORM_strx1235	.byte	62                              # DW_AT_encoding236	.byte	11                              # DW_FORM_data1237	.byte	11                              # DW_AT_byte_size238	.byte	11                              # DW_FORM_data1239	.byte	0                               # EOM(1)240	.byte	0                               # EOM(2)241	.byte	10                              # Abbreviation Code242	.byte	53                              # DW_TAG_volatile_type243	.byte	0                               # DW_CHILDREN_no244	.byte	73                              # DW_AT_type245	.byte	19                              # DW_FORM_ref4246	.byte	0                               # EOM(1)247	.byte	0                               # EOM(2)248	.byte	0                               # EOM(3)249	.section	.debug_info,"",@progbits250.Lcu_begin0:251	.long	.Ldebug_info_end0-.Ldebug_info_start0 # Length of Unit252.Ldebug_info_start0:253	.short	5                               # DWARF version number254	.byte	1                               # DWARF Unit Type255	.byte	8                               # Address Size (in bytes)256	.long	.debug_abbrev                   # Offset Into Abbrev. Section257	.byte	1                               # Abbrev [1] 0xc:0x66 DW_TAG_compile_unit258	.byte	0                               # DW_AT_producer259	.short	29                              # DW_AT_language260	.byte	1                               # DW_AT_name261	.long	.Lstr_offsets_base0             # DW_AT_str_offsets_base262	.long	.Lline_table_start0             # DW_AT_stmt_list263	.byte	2                               # DW_AT_comp_dir264	.byte	0                               # DW_AT_low_pc265	.long	.Lfunc_end0-.Lfunc_begin0       # DW_AT_high_pc266	.long	.Laddr_table_base0              # DW_AT_addr_base267	.long	.Lloclists_table_base0          # DW_AT_loclists_base268	.byte	2                               # Abbrev [2] 0x27:0x33 DW_TAG_subprogram269	.byte	0                               # DW_AT_low_pc270	.long	.Lfunc_end0-.Lfunc_begin0       # DW_AT_high_pc271	.byte	1                               # DW_AT_frame_base272	.byte	86273                                        # DW_AT_call_all_calls274	.byte	5                               # DW_AT_name275	.byte	0                               # DW_AT_decl_file276	.byte	5                               # DW_AT_decl_line277                                        # DW_AT_prototyped278	.long	104                             # DW_AT_type279                                        # DW_AT_external280	.byte	3                               # Abbrev [3] 0x36:0x9 DW_TAG_formal_parameter281	.byte	0                               # DW_AT_location282	.byte	7                               # DW_AT_name283	.byte	0                               # DW_AT_decl_file284	.byte	5                               # DW_AT_decl_line285	.long	104                             # DW_AT_type286	.byte	4                               # Abbrev [4] 0x3f:0xb DW_TAG_variable287	.byte	2                               # DW_AT_location288	.byte	145289	.byte	124290	.byte	6                               # DW_AT_name291	.byte	0                               # DW_AT_decl_file292	.byte	6                               # DW_AT_decl_line293	.long	108                             # DW_AT_type294	.byte	5                               # Abbrev [5] 0x4a:0x9 DW_TAG_variable295	.byte	1                               # DW_AT_location296	.byte	8                               # DW_AT_name297	.byte	0                               # DW_AT_decl_file298	.byte	8                               # DW_AT_decl_line299	.long	104                             # DW_AT_type300	.byte	6                               # Abbrev [6] 0x53:0x6 DW_TAG_call_site301	.long	90                              # DW_AT_call_origin302	.byte	1                               # DW_AT_call_return_pc303	.byte	0                               # End Of Children Mark304	.byte	7                               # Abbrev [7] 0x5a:0xe DW_TAG_subprogram305	.byte	3                               # DW_AT_name306	.byte	0                               # DW_AT_decl_file307	.byte	2                               # DW_AT_decl_line308                                        # DW_AT_prototyped309	.long	104                             # DW_AT_type310                                        # DW_AT_declaration311                                        # DW_AT_external312	.byte	8                               # Abbrev [8] 0x62:0x5 DW_TAG_formal_parameter313	.long	104                             # DW_AT_type314	.byte	0                               # End Of Children Mark315	.byte	9                               # Abbrev [9] 0x68:0x4 DW_TAG_base_type316	.byte	4                               # DW_AT_name317	.byte	5                               # DW_AT_encoding318	.byte	4                               # DW_AT_byte_size319	.byte	10                              # Abbrev [10] 0x6c:0x5 DW_TAG_volatile_type320	.long	104                             # DW_AT_type321	.byte	0                               # End Of Children Mark322.Ldebug_info_end0:323	.section	.debug_str_offsets,"",@progbits324	.long	40                              # Length of String Offsets Set325	.short	5326	.short	0327.Lstr_offsets_base0:328	.section	.debug_str,"MS",@progbits,1329.Linfo_string0:330	.asciz	"clang version 22.0.0git (https://github.com/UltimateForce21/llvm-project.git 79c0a9e1e7da0f727c41d27c9c6ff8a28bb7d06f)" # string offset=0331.Linfo_string1:332	.asciz	"live_across_call.c"            # string offset=119333.Linfo_string2:334	.asciz	"."                             # string offset=138335.Linfo_string3:336	.asciz	"leaf"                          # string offset=140337.Linfo_string4:338	.asciz	"int"                           # string offset=145339.Linfo_string5:340	.asciz	"live_across_call"              # string offset=149341.Linfo_string6:342	.asciz	"a"                             # string offset=166343.Linfo_string7:344	.asciz	"x"                             # string offset=168345.Linfo_string8:346	.asciz	"r"                             # string offset=170347	.section	.debug_str_offsets,"",@progbits348	.long	.Linfo_string0349	.long	.Linfo_string1350	.long	.Linfo_string2351	.long	.Linfo_string3352	.long	.Linfo_string4353	.long	.Linfo_string5354	.long	.Linfo_string6355	.long	.Linfo_string7356	.long	.Linfo_string8357	.section	.debug_addr,"",@progbits358	.long	.Ldebug_addr_end0-.Ldebug_addr_start0 # Length of contribution359.Ldebug_addr_start0:360	.short	5                               # DWARF version number361	.byte	8                               # Address size362	.byte	0                               # Segment selector size363.Laddr_table_base0:364	.quad	.Lfunc_begin0365	.quad	.Ltmp2366.Ldebug_addr_end0:367	.ident	"clang version 22.0.0git (https://github.com/UltimateForce21/llvm-project.git 79c0a9e1e7da0f727c41d27c9c6ff8a28bb7d06f)"368	.section	".note.GNU-stack","",@progbits369	.addrsig370	.section	.debug_line,"",@progbits371.Lline_table_start0:372