-
Notifications
You must be signed in to change notification settings - Fork 11.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add option to limit Debugify to locations (omitting variables)
Summary: It can be helpful to test behaviour w.r.t locations without having DEBUG_VALUE around. In particular, because DEBUG_VALUE has the potential to change CodeGen behaviour (e.g. hasOneUse() vs hasOneNonDbgUse()) while locations generally don't. Reviewers: aprantl, bogner Subscribers: hiraditya, llvm-commits Tags: #llvm Differential Revision: https://reviews.llvm.org/D77438
- Loading branch information
1 parent
41610d6
commit 15f7bc7
Showing
2 changed files
with
35 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
; RUN: opt -debugify -S < %s | FileCheck --check-prefixes=ALL,VALUE %s | ||
; RUN: opt -debugify -debugify-level=locations -S < %s | FileCheck --check-prefixes=ALL --implicit-check-not=dbg.value %s | ||
|
||
; ALL-LABEL: @test | ||
define void @test() { | ||
%add = add i32 1, 2 | ||
; ALL-NEXT: %add = add i32 1, 2, !dbg [[L1:![0-9]+]] | ||
; VALUE-NEXT: call void @llvm.dbg.value(metadata i32 %add, metadata [[add:![0-9]+]], metadata !DIExpression()), !dbg [[L1]] | ||
%sub = sub i32 %add, 1 | ||
; ALL-NEXT: %sub = sub i32 %add, 1, !dbg [[L2:![0-9]+]] | ||
; VALUE-NEXT: call void @llvm.dbg.value(metadata i32 %sub, metadata [[sub:![0-9]+]], metadata !DIExpression()), !dbg [[L2]] | ||
; ALL-NEXT: ret void, !dbg [[L3:![0-9]+]] | ||
ret void | ||
} | ||
|
||
; VALUE: [[add]] = !DILocalVariable | ||
; VALUE: [[sub]] = !DILocalVariable | ||
|
||
; ALL: [[L1]] = !DILocation(line: 1, column: 1, scope: | ||
; ALL: [[L2]] = !DILocation(line: 2, column: 1, scope: | ||
; ALL: [[L3]] = !DILocation(line: 3, column: 1, scope: |