Patch 1/4 adding bitcode support. Store whether or not a function is using Key Instructions in its DISubprogram so that we don't need to rely on the -mllvm flag -dwarf-use-key-instructions to determine whether or not to interpret Key Instructions metadata to decide is_stmt placement at DWARF emission time. This makes bitcode support simple and enables well defined mixing of non-key-instructions and key-instructions functions in an LTO context. This patch adds the bit (using DISubprogram::SubclassData1). PR 144104 and 144103 use it during DWARF emission. PR 44102 adds bitcode support. See pull request for overview of alternative attempts.
50 lines
1.8 KiB
LLVM
50 lines
1.8 KiB
LLVM
; RUN: opt -passes=debugify --debugify-atoms -S -o - < %s \
|
|
; RUN: | FileCheck %s
|
|
|
|
;; Mirrors llvm/test/DebugInfo/debugify.ll. Split out here because the
|
|
;; test is only supported if LLVM_EXPERIMENTAL_KEY_INSTRUCTIONS is enabled
|
|
;; (which is a condition for running this test directory). Once the conditional
|
|
;; compilation of the feature is removed this can be merged into the original.
|
|
|
|
; CHECK-LABEL: define void @foo
|
|
define void @foo() {
|
|
; CHECK: ret void, !dbg ![[RET1:.*]]
|
|
ret void
|
|
}
|
|
|
|
; CHECK-LABEL: define i32 @bar
|
|
define i32 @bar() {
|
|
; CHECK: call void @foo(), !dbg ![[CALL1:.*]]
|
|
call void @foo()
|
|
|
|
; CHECK: add i32 0, 1, !dbg ![[ADD1:.*]]
|
|
%sum = add i32 0, 1
|
|
|
|
; CHECK: ret i32 0, !dbg ![[RET2:.*]]
|
|
ret i32 0
|
|
}
|
|
|
|
; CHECK-LABEL: define weak_odr zeroext i1 @baz
|
|
define weak_odr zeroext i1 @baz() {
|
|
; CHECK-NOT: !dbg
|
|
ret i1 false
|
|
}
|
|
|
|
; CHECK-LABEL: define i32 @boom
|
|
define i32 @boom() {
|
|
; CHECK: [[result:%.*]] = musttail call i32 @bar(), !dbg ![[musttail:.*]]
|
|
%retval = musttail call i32 @bar()
|
|
; CHECK-NEXT: ret i32 [[result]], !dbg ![[musttailRes:.*]]
|
|
ret i32 %retval
|
|
}
|
|
|
|
; CHECK: distinct !DISubprogram(name: "foo", {{.*}}keyInstructions: true)
|
|
; CHECK-DAG: ![[RET1]] = !DILocation(line: 1, {{.*}}, atomGroup: 1, atomRank: 1
|
|
; CHECK: distinct !DISubprogram(name: "bar", {{.*}}keyInstructions: true)
|
|
; CHECK-DAG: ![[CALL1]] = !DILocation(line: 2, {{.*}}, atomGroup: 2, atomRank: 1
|
|
; CHECK-DAG: ![[ADD1]] = !DILocation(line: 3, {{.*}}, atomGroup: 3, atomRank: 1
|
|
; CHECK-DAG: ![[RET2]] = !DILocation(line: 4, {{.*}}, atomGroup: 4, atomRank: 1
|
|
; CHECK: distinct !DISubprogram(name: "boom", {{.*}}keyInstructions: true)
|
|
; CHECK-DAG: ![[musttail]] = !DILocation(line: 5, {{.*}}, atomGroup: 5, atomRank: 1
|
|
; CHECK-DAG: ![[musttailRes]] = !DILocation(line: 6, {{.*}}, atomGroup: 6, atomRank: 1
|