Commit Graph

10 Commits

Author SHA1 Message Date
Eric Christopher
83650cacf7 Revert "Temporarily revert "[DEBUG] Initial adaptation of NVPTX target for debug info emission.""
This reapplies commits: r330271, r330592, r330779.

    [DEBUG] Initial adaptation of NVPTX target for debug info emission.

    Summary:
    Patch adds initial emission of the debug info for NVPTX target.
    Currently, only .file and .loc directives are emitted, everything else is
    commented out to not break the compilation of Cuda.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@332689 91177308-0d34-0410-b5e6-96231b3b80d8
2018-05-18 03:13:08 +00:00
Shiva Chen
a8a13bc662 [DebugInfo] Add DILabel metadata and intrinsic llvm.dbg.label.
In order to set breakpoints on labels and list source code around
labels, we need collect debug information for labels, i.e., label
name, the function label belong, line number in the file, and the
address label located. In order to keep these information in LLVM
IR and to allow backend to generate debug information correctly.
We create a new kind of metadata for labels, DILabel. The format
of DILabel is

!DILabel(scope: !1, name: "foo", file: !2, line: 3)

We hope to keep debug information as much as possible even the
code is optimized. So, we create a new kind of intrinsic for label
metadata to avoid the metadata is eliminated with basic block.
The intrinsic will keep existing if we keep it from optimized out.
The format of the intrinsic is

llvm.dbg.label(metadata !1)

It has only one argument, that is the DILabel metadata. The
intrinsic will follow the label immediately. Backend could get the
label metadata through the intrinsic's parameter.

We also create DIBuilder API for labels to be used by Frontend.
Frontend could use createLabel() to allocate DILabel objects, and use
insertLabel() to insert llvm.dbg.label intrinsic in LLVM IR.

Differential Revision: https://reviews.llvm.org/D45024

Patch by Hsiangkai Wang.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@331841 91177308-0d34-0410-b5e6-96231b3b80d8
2018-05-09 02:40:45 +00:00
Eric Christopher
d3fc40c71b Temporarily revert "[DEBUG] Initial adaptation of NVPTX target for debug info emission."
This appears to have some issues associated with the file directive output
causing multiple global symbols with the name "file" to be emitted into a
startup section. I'm investigating more specific causes and working with the
original author.

This reverts commit r330271.

Also Revert "[DEBUGINFO, NVPTX] Add the test for the debug info of the local"

This reverts commit r330592 and the follow up of 330779 as the testcase is dependent upon r330271.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@331237 91177308-0d34-0410-b5e6-96231b3b80d8
2018-05-01 00:10:13 +00:00
Reid Kleckner
16e61f3c89 Fix path separator checks on Windows
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@330779 91177308-0d34-0410-b5e6-96231b3b80d8
2018-04-24 22:03:07 +00:00
Alexey Bataev
ec94ea919c [DEBUGINFO, NVPTX] Add the test for the debug info of the local
variables, NFC.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@330592 91177308-0d34-0410-b5e6-96231b3b80d8
2018-04-23 14:00:53 +00:00
Alexey Bataev
f44d5a8b28 [DEBUG] Initial adaptation of NVPTX target for debug info emission.
Summary:
Patch adds initial emission of the debug info for NVPTX target.
Currently, only .file and .loc directives are emitted, everything else is
commented out to not break the compilation of Cuda.

Reviewers: echristo, jlebar, tra, jholewinski

Subscribers: mgorny, aprantl, JDevlieghere, llvm-commits

Differential Revision: https://reviews.llvm.org/D41827

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@330271 91177308-0d34-0410-b5e6-96231b3b80d8
2018-04-18 16:13:41 +00:00
Artem Belevich
3b79cbb574 [NVPTX] Removed 'satom' feature which is no longer used.
Differential Revision: https://reviews.llvm.org/D45061

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@329830 91177308-0d34-0410-b5e6-96231b3b80d8
2018-04-11 17:51:33 +00:00
Alexey Bataev
29ed9fd693 [DEBUG] Fix debug info test for NVPTX, NFC.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@321835 91177308-0d34-0410-b5e6-96231b3b80d8
2018-01-04 23:50:24 +00:00
Alexey Bataev
c60b02f14f [DEBUG] Fix the test for NVPTX, NFC.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@321829 91177308-0d34-0410-b5e6-96231b3b80d8
2018-01-04 23:01:42 +00:00
Alexey Bataev
6072d5d178 [DEBUG] Add initial tests for debug info for NVPTX target, NFC.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@321822 91177308-0d34-0410-b5e6-96231b3b80d8
2018-01-04 21:07:07 +00:00