llvm.org GIT mirror llvm / 50dd59a
Merging r244728: ------------------------------------------------------------------------ r244728 | Matthew.Arsenault | 2015-08-12 05:04:44 -0400 (Wed, 12 Aug 2015) | 2 lines AMDGPU: Fix assert on dbg_value instructions ------------------------------------------------------------------------ git-svn-id: https://llvm.org/svn/llvm-project/llvm/branches/release_37@253234 91177308-0d34-0410-b5e6-96231b3b80d8 Tom Stellard 3 years ago
2 changed file(s) with 43 addition(s) and 0 deletion(s). Raw diff Collapse all Expand all
263263 for (const MachineBasicBlock &MBB : MF) {
264264 for (const MachineInstr &MI : MBB) {
265265 // TODO: CodeSize should account for multiple functions.
266
267 // TODO: Should we count size of debug info?
268 if (MI.isDebugValue())
269 continue;
270
271 // FIXME: This is reporting 0 for many instructions.
266272 CodeSize += MI.getDesc().Size;
267273
268274 unsigned numOperands = MI.getNumOperands();
0 ; RUN: llc -O0 -march=amdgcn -mtriple=amdgcn-unknown-amdhsa -verify-machineinstrs < %s | FileCheck %s
1
2 ; CHECK-LABEL: {{^}}test_debug_value:
3 ; CHECK: s_load_dwordx2
4 ; CHECK: DEBUG_VALUE: test_debug_value:globalptr_arg <- SGPR0_SGPR1
5 ; CHECK: buffer_store_dword
6 ; CHECK: s_endpgm
7 define void @test_debug_value(i32 addrspace(1)* nocapture %globalptr_arg) #0 {
8 entry:
9 tail call void @llvm.dbg.value(metadata i32 addrspace(1)* %globalptr_arg, i64 0, metadata !10, metadata !13), !dbg !14
10 store i32 123, i32 addrspace(1)* %globalptr_arg, align 4
11 ret void
12 }
13
14 declare void @llvm.dbg.value(metadata, i64, metadata, metadata) #1
15
16 attributes #0 = { nounwind "disable-tail-calls"="false" "less-precise-fpmad"="false" "no-frame-pointer-elim"="true" "no-frame-pointer-elim-non-leaf" "no-infs-fp-math"="false" "no-nans-fp-math"="false" "stack-protector-buffer-size"="8" "unsafe-fp-math"="false" "use-soft-float"="false" }
17 attributes #1 = { nounwind readnone }
18
19 !llvm.dbg.cu = !{!0}
20 !llvm.module.flags = !{!11, !12}
21
22 !0 = distinct !DICompileUnit(language: DW_LANG_C99, file: !1, producer: "clang version 3.8.0 (trunk 244715) (llvm/trunk 244718)", isOptimized: true, runtimeVersion: 0, emissionKind: 1, enums: !2, subprograms: !3)
23 !1 = !DIFile(filename: "/tmp/test_debug_value.cl", directory: "/Users/matt/src/llvm/build_debug")
24 !2 = !{}
25 !3 = !{!4}
26 !4 = !DISubprogram(name: "test_debug_value", scope: !1, file: !1, line: 1, type: !5, isLocal: false, isDefinition: true, scopeLine: 2, flags: DIFlagPrototyped, isOptimized: true, function: void (i32 addrspace(1)*)* @test_debug_value, variables: !9)
27 !5 = !DISubroutineType(types: !6)
28 !6 = !{null, !7}
29 !7 = !DIDerivedType(tag: DW_TAG_pointer_type, baseType: !8, size: 64, align: 32)
30 !8 = !DIBasicType(name: "int", size: 32, align: 32, encoding: DW_ATE_signed)
31 !9 = !{!10}
32 !10 = !DILocalVariable(tag: DW_TAG_arg_variable, name: "globalptr_arg", arg: 1, scope: !4, file: !1, line: 1, type: !7)
33 !11 = !{i32 2, !"Dwarf Version", i32 4}
34 !12 = !{i32 2, !"Debug Info Version", i32 3}
35 !13 = !DIExpression()
36 !14 = !DILocation(line: 1, column: 42, scope: !4)