llvm.org GIT mirror llvm / 80733cc
[ARM GlobalISel] Support DBG_VALUE Make sure we can map and select DBG_VALUE. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@357681 91177308-0d34-0410-b5e6-96231b3b80d8 Diana Picus 9 months ago
3 changed file(s) with 120 addition(s) and 0 deletion(s). Raw diff Collapse all Expand all
422422 OperandsMapping =
423423 getOperandsMapping({&ARM::ValueMappings[ARM::GPR3OpsIdx], nullptr});
424424 break;
425 case DBG_VALUE: {
426 SmallVector OperandBanks(NumOperands);
427 if (MI.getOperand(0).isReg() && MI.getOperand(0).getReg())
428 OperandBanks[0] = &ARM::ValueMappings[ARM::GPR3OpsIdx];
429 OperandsMapping = getOperandsMapping(OperandBanks);
430 break;
431 }
425432 default:
426433 return getInvalidInstructionMapping();
427434 }
8282
8383 define void @test_soft_fp_s64() #0 { ret void }
8484
85 define void @test_dbg_value() #0 { ret void }
86
8587 attributes #0 = { "target-features"="+vfp2"}
8688 attributes #1 = { "target-features"="+hwdiv-arm,+hwdiv" }
8789 attributes #2 = { "target-features"="+vfp4"}
8890 attributes #3 = { "target-features"="+v5t"}
91
92 !0 = distinct !DICompileUnit(language: DW_LANG_C99, file: !1, producer: "llvm", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug, enums: !2)
93 !1 = !DIFile(filename: "dbg.ll", directory: "/tmp")
94 !2 = !{}
95 !5 = distinct !DISubprogram(name: "test_dbg_value", scope: !1, file: !1, line: 1, type: !6, isLocal: false, isDefinition: true, scopeLine: 1, flags: DIFlagPrototyped, isOptimized: false, unit: !0, retainedNodes: !2)
96 !6 = !DISubroutineType(types: !2)
97 !7 = !DILocalVariable(name: "x", arg: 1, scope: !5, file: !1, line: 1, type: !8)
98 !8 = !DIBasicType(name: "int", size: 32, encoding: DW_ATE_signed)
99 !9 = !DILocation(line: 1, column: 1, scope: !5)
89100 ...
90101 ---
91102 name: test_add_s32
14781489 BX_RET 14, $noreg, implicit $r0, implicit $r1
14791490
14801491 ...
1492 ---
1493 name: test_dbg_value
1494 # CHECK-LABEL: name: test_dbg_value
1495 legalized: true
1496 regBankSelected: false
1497 selected: false
1498
1499 registers:
1500 - { id: 0, class: _ }
1501 - { id: 1, class: _ }
1502 - { id: 2, class: _ }
1503 - { id: 3, class: _ }
1504 body: |
1505 bb.0:
1506 liveins: $r0, $s1
1507
1508 %0(s32) = COPY $r0
1509 %1(s32) = COPY $s1
1510
1511 ; {{%[0-9]+}}:gpr = G_ADD
1512 %2(s32) = G_ADD %0, %0
1513
1514 ; DBG_VALUE {{%[0-9]+}}:gpr, $noreg, !7, !DIExpression(), debug-location !9
1515 DBG_VALUE %2(s32), $noreg, !7, !DIExpression(), debug-location !9
1516
1517 ; {{%[0-9]+}}:fpr = G_FADD
1518 %3(s32) = G_FADD %1, %1
1519
1520 ; DBG_VALUE {{%[0-9]+}}:fpr, $noreg, !7, !DIExpression(), debug-location !9
1521 DBG_VALUE %3(s32), $noreg, !7, !DIExpression(), debug-location !9
1522
1523 ; DBG_VALUE i32 42, 0, !7, !DIExpression(), debug-location !9
1524 DBG_VALUE i32 42, 0, !7, !DIExpression(), debug-location !9
1525
1526 ; DBG_VALUE float 1.000000e+00, 0, !7, !DIExpression(), debug-location !9
1527 DBG_VALUE float 1.000000e+00, 0, !7, !DIExpression(), debug-location !9
1528
1529 ; DBG_VALUE $noreg, 0, !7, !DIExpression(), debug-location !9
1530 DBG_VALUE $noreg, 0, !7, !DIExpression(), debug-location !9
1531
1532 $r0 = COPY %2(s32)
1533 $s1 = COPY %3(s32)
1534 BX_RET 14, $noreg, implicit $r0, implicit $s1
1535
1536 ...
0 # RUN: llc -O0 -mtriple arm-- -mattr=+vfp2 -run-pass=instruction-select -verify-machineinstrs %s -o - | FileCheck %s --check-prefixes=CHECK,ARM
1 # RUN: llc -O0 -mtriple thumb-- -mattr=+v6t2,+vfp2 -run-pass=instruction-select -verify-machineinstrs %s -o - | FileCheck %s --check-prefixes=CHECK,THUMB
2 --- |
3 define void @test_dbg_value() #0 { ret void }
4
5 !0 = distinct !DICompileUnit(language: DW_LANG_C99, file: !1, producer: "llvm", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug, enums: !2)
6 !1 = !DIFile(filename: "dbg.ll", directory: "/tmp")
7 !2 = !{}
8 !5 = distinct !DISubprogram(name: "test_dbg_value", scope: !1, file: !1, line: 1, type: !6, isLocal: false, isDefinition: true, scopeLine: 1, flags: DIFlagPrototyped, isOptimized: false, unit: !0, retainedNodes: !2)
9 !6 = !DISubroutineType(types: !2)
10 !7 = !DILocalVariable(name: "x", arg: 1, scope: !5, file: !1, line: 1, type: !8)
11 !8 = !DIBasicType(name: "int", size: 32, encoding: DW_ATE_signed)
12 !9 = !DILocation(line: 1, column: 1, scope: !5)
13 ...
14 ---
15 name: test_dbg_value
16 # CHECK-LABEL: name: test_dbg_value
17 legalized: true
18 regBankSelected: true
19 selected: false
20 # CHECK: selected: true
21 registers:
22 - { id: 0, class: gprb }
23 - { id: 1, class: fprb }
24 - { id: 2, class: gprb }
25 - { id: 3, class: fprb }
26 body: |
27 bb.0:
28 liveins: $r0, $s1
29
30 %0(s32) = COPY $r0
31 %1(s32) = COPY $s1
32
33 %2(s32) = G_ADD %0, %0
34
35 ; DBG_VALUE {{%[0-9]+}}:gpr, $noreg, !7, !DIExpression(), debug-location !9
36 DBG_VALUE %2(s32), $noreg, !7, !DIExpression(), debug-location !9
37
38 %3(s32) = G_FADD %1, %1
39
40 ; DBG_VALUE {{%[0-9]+}}:spr, $noreg, !7, !DIExpression(), debug-location !9
41 DBG_VALUE %3(s32), $noreg, !7, !DIExpression(), debug-location !9
42
43 ; DBG_VALUE i32 42, 0, !7, !DIExpression(), debug-location !9
44 DBG_VALUE i32 42, 0, !7, !DIExpression(), debug-location !9
45
46 ; DBG_VALUE float 1.000000e+00, 0, !7, !DIExpression(), debug-location !9
47 DBG_VALUE float 1.000000e+00, 0, !7, !DIExpression(), debug-location !9
48
49 ; DBG_VALUE $noreg, 0, !7, !DIExpression(), debug-location !9
50 DBG_VALUE $noreg, 0, !7, !DIExpression(), debug-location !9
51
52 $r0 = COPY %2(s32)
53 $s1 = COPY %3(s32)
54 BX_RET 14, $noreg, implicit $r0, implicit $s1
55
56 ...