1# clang++ -g -gdwarf-4 -emit-llvm -S helper.cpp 2# llc -O2 -mtriple=x86_64-unknown-linux-gnu helper.ll 3# int z = 0; 4# int d = 0; 5# 6# int helper(int z_, int d_) { 7# z += z_; 8# d += d_; 9# return z * d; 10# } 11 12 .text 13 .file "helper.cpp" 14 .file 1 "." "helper.cpp" 15 .globl _Z6helperii # -- Begin function _Z6helperii 16 .p2align 4, 0x90 17 .type _Z6helperii,@function 18_Z6helperii: # @_Z6helperii 19.Lfunc_begin0: 20 .loc 1 4 0 # helper.cpp:4:0 21 .cfi_startproc 22# %bb.0: # %entry 23 #DEBUG_VALUE: helper:z_ <- $edi 24 #DEBUG_VALUE: helper:d_ <- $esi 25 movl %esi, %eax 26.Ltmp0: 27 .loc 1 5 4 prologue_end # helper.cpp:5:4 28 addl z(%rip), %edi 29.Ltmp1: 30 #DEBUG_VALUE: helper:z_ <- [DW_OP_LLVM_entry_value 1] $edi 31 .loc 1 6 4 # helper.cpp:6:4 32 addl d(%rip), %eax 33 .loc 1 5 4 # helper.cpp:5:4 34 movl %edi, z(%rip) 35 .loc 1 6 4 # helper.cpp:6:4 36 movl %eax, d(%rip) 37 .loc 1 7 11 # helper.cpp:7:11 38 imull %edi, %eax 39 .loc 1 7 2 is_stmt 0 # helper.cpp:7:2 40 retq 41.Ltmp2: 42.Lfunc_end0: 43 .size _Z6helperii, .Lfunc_end0-_Z6helperii 44 .cfi_endproc 45 # -- End function 46 .type z,@object # @z 47 .bss 48 .globl z 49 .p2align 2 50z: 51 .long 0 # 0x0 52 .size z, 4 53 54 .type d,@object # @d 55 .globl d 56 .p2align 2 57d: 58 .long 0 # 0x0 59 .size d, 4 60 61 .section .debug_loc.dwo,"e",@progbits 62.Ldebug_loc0: 63 .byte 3 64 .byte 2 65 .long .Ltmp1-.Lfunc_begin0 66 .short 1 # Loc expr size 67 .byte 85 # super-register DW_OP_reg5 68 .byte 3 69 .byte 3 70 .long .Lfunc_end0-.Ltmp1 71 .short 4 # Loc expr size 72 .byte 243 # DW_OP_GNU_entry_value 73 .byte 1 # 1 74 .byte 85 # super-register DW_OP_reg5 75 .byte 159 # DW_OP_stack_value 76 .byte 0 77 .section .debug_abbrev,"",@progbits 78 .byte 1 # Abbreviation Code 79 .byte 17 # DW_TAG_compile_unit 80 .byte 0 # DW_CHILDREN_no 81 .byte 16 # DW_AT_stmt_list 82 .byte 23 # DW_FORM_sec_offset 83 .byte 27 # DW_AT_comp_dir 84 .byte 14 # DW_FORM_strp 85 .ascii "\260B" # DW_AT_GNU_dwo_name 86 .byte 14 # DW_FORM_strp 87 .ascii "\261B" # DW_AT_GNU_dwo_id 88 .byte 7 # DW_FORM_data8 89 .byte 17 # DW_AT_low_pc 90 .byte 1 # DW_FORM_addr 91 .byte 18 # DW_AT_high_pc 92 .byte 6 # DW_FORM_data4 93 .ascii "\263B" # DW_AT_GNU_addr_base 94 .byte 23 # DW_FORM_sec_offset 95 .byte 0 # EOM(1) 96 .byte 0 # EOM(2) 97 .byte 0 # EOM(3) 98 .section .debug_info,"",@progbits 99.Lcu_begin0: 100 .long .Ldebug_info_end0-.Ldebug_info_start0 # Length of Unit 101.Ldebug_info_start0: 102 .short 4 # DWARF version number 103 .long .debug_abbrev # Offset Into Abbrev. Section 104 .byte 8 # Address Size (in bytes) 105 .byte 1 # Abbrev [1] 0xb:0x25 DW_TAG_compile_unit 106 .long .Lline_table_start0 # DW_AT_stmt_list 107 .long .Lskel_string0 # DW_AT_comp_dir 108 .long .Lskel_string1 # DW_AT_GNU_dwo_name 109 .quad -5732284259998169791 # DW_AT_GNU_dwo_id 110 .quad .Lfunc_begin0 # DW_AT_low_pc 111 .long .Lfunc_end0-.Lfunc_begin0 # DW_AT_high_pc 112 .long .Laddr_table_base0 # DW_AT_GNU_addr_base 113.Ldebug_info_end0: 114 .section .debug_str,"MS",@progbits,1 115.Lskel_string0: 116 .asciz "." # string offset=0 117.Lskel_string1: 118 .asciz "helper.dwo" # string offset=2 119 .section .debug_str.dwo,"eMS",@progbits,1 120.Linfo_string0: 121 .asciz "z" # string offset=0 122.Linfo_string1: 123 .asciz "int" # string offset=2 124.Linfo_string2: 125 .asciz "d" # string offset=6 126.Linfo_string3: 127 .asciz "_Z6helperii" # string offset=8 128.Linfo_string4: 129 .asciz "helper" # string offset=20 130.Linfo_string5: 131 .asciz "z_" # string offset=27 132.Linfo_string6: 133 .asciz "d_" # string offset=30 134.Linfo_string7: 135 .asciz "clang version 15.0.0" # string offset=33 136.Linfo_string8: 137 .asciz "helper.cpp" # string offset=54 138.Linfo_string9: 139 .asciz "helper.dwo" # string offset=65 140 .section .debug_str_offsets.dwo,"e",@progbits 141 .long 0 142 .long 2 143 .long 6 144 .long 8 145 .long 20 146 .long 27 147 .long 30 148 .long 33 149 .long 54 150 .long 65 151 .section .debug_info.dwo,"e",@progbits 152 .long .Ldebug_info_dwo_end0-.Ldebug_info_dwo_start0 # Length of Unit 153.Ldebug_info_dwo_start0: 154 .short 4 # DWARF version number 155 .long 0 # Offset Into Abbrev. Section 156 .byte 8 # Address Size (in bytes) 157 .byte 1 # Abbrev [1] 0xb:0x50 DW_TAG_compile_unit 158 .byte 7 # DW_AT_producer 159 .short 33 # DW_AT_language 160 .byte 8 # DW_AT_name 161 .byte 9 # DW_AT_GNU_dwo_name 162 .quad -5732284259998169791 # DW_AT_GNU_dwo_id 163 .byte 2 # Abbrev [2] 0x19:0xb DW_TAG_variable 164 .byte 0 # DW_AT_name 165 .long 36 # DW_AT_type 166 # DW_AT_external 167 .byte 1 # DW_AT_decl_file 168 .byte 1 # DW_AT_decl_line 169 .byte 2 # DW_AT_location 170 .byte 251 171 .byte 0 172 .byte 3 # Abbrev [3] 0x24:0x4 DW_TAG_base_type 173 .byte 1 # DW_AT_name 174 .byte 5 # DW_AT_encoding 175 .byte 4 # DW_AT_byte_size 176 .byte 2 # Abbrev [2] 0x28:0xb DW_TAG_variable 177 .byte 2 # DW_AT_name 178 .long 36 # DW_AT_type 179 # DW_AT_external 180 .byte 1 # DW_AT_decl_file 181 .byte 2 # DW_AT_decl_line 182 .byte 2 # DW_AT_location 183 .byte 251 184 .byte 1 185 .byte 4 # Abbrev [4] 0x33:0x27 DW_TAG_subprogram 186 .byte 2 # DW_AT_low_pc 187 .long .Lfunc_end0-.Lfunc_begin0 # DW_AT_high_pc 188 .byte 1 # DW_AT_frame_base 189 .byte 87 190 # DW_AT_GNU_all_call_sites 191 .byte 3 # DW_AT_linkage_name 192 .byte 4 # DW_AT_name 193 .byte 1 # DW_AT_decl_file 194 .byte 4 # DW_AT_decl_line 195 .long 36 # DW_AT_type 196 # DW_AT_external 197 .byte 5 # Abbrev [5] 0x43:0xc DW_TAG_formal_parameter 198 .long .Ldebug_loc0-.debug_loc.dwo # DW_AT_location 199 .byte 5 # DW_AT_name 200 .byte 1 # DW_AT_decl_file 201 .byte 4 # DW_AT_decl_line 202 .long 36 # DW_AT_type 203 .byte 6 # Abbrev [6] 0x4f:0xa DW_TAG_formal_parameter 204 .byte 1 # DW_AT_location 205 .byte 84 206 .byte 6 # DW_AT_name 207 .byte 1 # DW_AT_decl_file 208 .byte 4 # DW_AT_decl_line 209 .long 36 # DW_AT_type 210 .byte 0 # End Of Children Mark 211 .byte 0 # End Of Children Mark 212.Ldebug_info_dwo_end0: 213 .section .debug_abbrev.dwo,"e",@progbits 214 .byte 1 # Abbreviation Code 215 .byte 17 # DW_TAG_compile_unit 216 .byte 1 # DW_CHILDREN_yes 217 .byte 37 # DW_AT_producer 218 .ascii "\202>" # DW_FORM_GNU_str_index 219 .byte 19 # DW_AT_language 220 .byte 5 # DW_FORM_data2 221 .byte 3 # DW_AT_name 222 .ascii "\202>" # DW_FORM_GNU_str_index 223 .ascii "\260B" # DW_AT_GNU_dwo_name 224 .ascii "\202>" # DW_FORM_GNU_str_index 225 .ascii "\261B" # DW_AT_GNU_dwo_id 226 .byte 7 # DW_FORM_data8 227 .byte 0 # EOM(1) 228 .byte 0 # EOM(2) 229 .byte 2 # Abbreviation Code 230 .byte 52 # DW_TAG_variable 231 .byte 0 # DW_CHILDREN_no 232 .byte 3 # DW_AT_name 233 .ascii "\202>" # DW_FORM_GNU_str_index 234 .byte 73 # DW_AT_type 235 .byte 19 # DW_FORM_ref4 236 .byte 63 # DW_AT_external 237 .byte 25 # DW_FORM_flag_present 238 .byte 58 # DW_AT_decl_file 239 .byte 11 # DW_FORM_data1 240 .byte 59 # DW_AT_decl_line 241 .byte 11 # DW_FORM_data1 242 .byte 2 # DW_AT_location 243 .byte 24 # DW_FORM_exprloc 244 .byte 0 # EOM(1) 245 .byte 0 # EOM(2) 246 .byte 3 # Abbreviation Code 247 .byte 36 # DW_TAG_base_type 248 .byte 0 # DW_CHILDREN_no 249 .byte 3 # DW_AT_name 250 .ascii "\202>" # DW_FORM_GNU_str_index 251 .byte 62 # DW_AT_encoding 252 .byte 11 # DW_FORM_data1 253 .byte 11 # DW_AT_byte_size 254 .byte 11 # DW_FORM_data1 255 .byte 0 # EOM(1) 256 .byte 0 # EOM(2) 257 .byte 4 # Abbreviation Code 258 .byte 46 # DW_TAG_subprogram 259 .byte 1 # DW_CHILDREN_yes 260 .byte 17 # DW_AT_low_pc 261 .ascii "\201>" # DW_FORM_GNU_addr_index 262 .byte 18 # DW_AT_high_pc 263 .byte 6 # DW_FORM_data4 264 .byte 64 # DW_AT_frame_base 265 .byte 24 # DW_FORM_exprloc 266 .ascii "\227B" # DW_AT_GNU_all_call_sites 267 .byte 25 # DW_FORM_flag_present 268 .byte 110 # DW_AT_linkage_name 269 .ascii "\202>" # DW_FORM_GNU_str_index 270 .byte 3 # DW_AT_name 271 .ascii "\202>" # DW_FORM_GNU_str_index 272 .byte 58 # DW_AT_decl_file 273 .byte 11 # DW_FORM_data1 274 .byte 59 # DW_AT_decl_line 275 .byte 11 # DW_FORM_data1 276 .byte 73 # DW_AT_type 277 .byte 19 # DW_FORM_ref4 278 .byte 63 # DW_AT_external 279 .byte 25 # DW_FORM_flag_present 280 .byte 0 # EOM(1) 281 .byte 0 # EOM(2) 282 .byte 5 # Abbreviation Code 283 .byte 5 # DW_TAG_formal_parameter 284 .byte 0 # DW_CHILDREN_no 285 .byte 2 # DW_AT_location 286 .byte 23 # DW_FORM_sec_offset 287 .byte 3 # DW_AT_name 288 .ascii "\202>" # DW_FORM_GNU_str_index 289 .byte 58 # DW_AT_decl_file 290 .byte 11 # DW_FORM_data1 291 .byte 59 # DW_AT_decl_line 292 .byte 11 # DW_FORM_data1 293 .byte 73 # DW_AT_type 294 .byte 19 # DW_FORM_ref4 295 .byte 0 # EOM(1) 296 .byte 0 # EOM(2) 297 .byte 6 # Abbreviation Code 298 .byte 5 # DW_TAG_formal_parameter 299 .byte 0 # DW_CHILDREN_no 300 .byte 2 # DW_AT_location 301 .byte 24 # DW_FORM_exprloc 302 .byte 3 # DW_AT_name 303 .ascii "\202>" # DW_FORM_GNU_str_index 304 .byte 58 # DW_AT_decl_file 305 .byte 11 # DW_FORM_data1 306 .byte 59 # DW_AT_decl_line 307 .byte 11 # DW_FORM_data1 308 .byte 73 # DW_AT_type 309 .byte 19 # DW_FORM_ref4 310 .byte 0 # EOM(1) 311 .byte 0 # EOM(2) 312 .byte 0 # EOM(3) 313 .section .debug_addr,"",@progbits 314.Laddr_table_base0: 315 .quad z 316 .quad d 317 .quad .Lfunc_begin0 318 .quad .Ltmp1 319 .ident "clang version 15.0.0" 320 .section ".note.GNU-stack","",@progbits 321 .section .debug_line,"",@progbits 322.Lline_table_start0: 323