llvm.org GIT mirror llvm / cf774b7
[DebugInfo] In FastISel, convert llvm.dbg.label to DBG_LABEL MI. Convert llvm.dbg.label(!label_metadata) to DBG_LABEL !label_metadata. Differential Revision: https://reviews.llvm.org/D50622 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@340122 91177308-0d34-0410-b5e6-96231b3b80d8 Hsiangkai Wang 1 year, 2 months ago
4 changed file(s) with 17 addition(s) and 5 deletion(s). Raw diff Collapse all Expand all
14251425 }
14261426 return true;
14271427 }
1428 case Intrinsic::dbg_label: {
1429 const DbgLabelInst *DI = cast(II);
1430 assert(DI->getLabel() && "Missing label");
1431 if (!FuncInfo.MF->getMMI().hasDebugInfo()) {
1432 LLVM_DEBUG(dbgs() << "Dropping debug info for " << *DI << "\n");
1433 return true;
1434 }
1435
1436 BuildMI(*FuncInfo.MBB, FuncInfo.InsertPt, DbgLoc,
1437 TII.get(TargetOpcode::DBG_LABEL)).addMetadata(DI->getLabel());
1438 return true;
1439 }
14281440 case Intrinsic::objectsize: {
14291441 ConstantInt *CI = cast(II->getArgOperand(1));
14301442 unsigned long long Res = CI->isZero() ? -1ULL : 0;
0 ; Test DBG_LABEL MachineInstr for label debugging.
11 ; REQUIRES: asserts
2 ; RUN: llc -fast-isel=false -debug-only=isel %s -o /dev/null 2> %t.debug
2 ; RUN: llc -debug-only=isel %s -o /dev/null 2> %t.debug
33 ; RUN: cat %t.debug | FileCheck %s --check-prefix=CHECKMI
44 ;
55 ; CHECKMI: DBG_LABEL "top", debug-location !9
66 ; CHECKMI: DBG_LABEL "done", debug-location !11
77 ;
8 ; RUN: llc -fast-isel=false %s -o - | FileCheck %s --check-prefix=CHECKASM
8 ; RUN: llc %s -o - | FileCheck %s --check-prefix=CHECKASM
99 ;
1010 ; CHECKASM: DEBUG_LABEL: foo:top
1111 ; CHECKASM: DEBUG_LABEL: foo:done
0 ; Test DBG_LABEL MachineInstr under optimization.
11 ; The test case is generated by clang with -O2 is on.
22 ; REQUIRES: asserts
3 ; RUN: llc -fast-isel=false -debug-only=isel %s -o /dev/null 2> %t.debug
3 ; RUN: llc -debug-only=isel %s -o /dev/null 2> %t.debug
44 ; RUN: cat %t.debug | FileCheck %s --check-prefix=CHECKMI
55 ;
66 ; CHECKMI: DBG_LABEL "end_sum", debug-location !17
None ; RUN: llc -fast-isel=false -O0 -filetype=obj -o - %s | llvm-dwarfdump -v - | FileCheck %s
0 ; RUN: llc -O0 -filetype=obj -o - %s | llvm-dwarfdump -v - | FileCheck %s
11 ;
22 ; CHECK: .debug_info contents:
33 ; CHECK: DW_TAG_label
1111 ; CHECK-NEXT: DW_AT_decl_line [DW_FORM_data1] {{.*}}7
1212 ; CHECK-NEXT: DW_AT_low_pc [DW_FORM_addr] {{.*}}{{0x[0-9a-f]+}}
1313 ;
14 ; RUN: llc -fast-isel=false -O0 -o - %s | FileCheck %s -check-prefix=ASM
14 ; RUN: llc -O0 -o - %s | FileCheck %s -check-prefix=ASM
1515 ;
1616 ; ASM: [[TOP_LOW_PC:[.0-9a-zA-Z]+]]:{{[[:space:]].*}}DEBUG_LABEL: foo:top
1717 ; ASM: [[DONE_LOW_PC:[.0-9a-zA-Z]+]]:{{[[:space:]].*}}DEBUG_LABEL: foo:done