Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Resubmit: [Salvage] Change salvage debug info implementation to use D…
…W_OP_LLVM_convert where needed Fixes issue: https://bugs.llvm.org/show_bug.cgi?id=40645 Previously, LLVM had no functional way of performing casts inside of a DIExpression(), which made salvaging cast instructions other than Noop casts impossible. With the recent addition of DW_OP_LLVM_convert this salvaging is now possible, and so can be used to fix the attached bug as well as any cases where SExt instruction results are lost in the debugging metadata. This patch introduces this fix by expanding the salvage debug info method to cover these cases using the new operator. Differential revision: https://reviews.llvm.org/D61184 llvm-svn: 360902
- Loading branch information
Showing
5 changed files
with
50 additions
and
4 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,25 @@ | ||
; RUN: opt %s -debugify -early-cse -S | FileCheck %s | ||
define i32 @foo(i64 %nose, i32 %more) { | ||
; CHECK-LABEL: @foo( | ||
; CHECK: call void @llvm.dbg.value(metadata i64 %nose, metadata [[V1:![0-9]+]], metadata !DIExpression(DW_OP_LLVM_convert, 64, DW_ATE_unsigned, DW_OP_LLVM_convert, 32, DW_ATE_unsigned | ||
; CHECK: call void @llvm.dbg.value(metadata i64 %nose.shift, metadata [[V2:![0-9]+]] | ||
; CHECK: call void @llvm.dbg.value(metadata i64 %nose.shift, metadata [[V3:![0-9]+]], metadata !DIExpression(DW_OP_LLVM_convert, 64, DW_ATE_unsigned, DW_OP_LLVM_convert, 32, DW_ATE_unsigned | ||
|
||
entry: | ||
%nose.trunc = trunc i64 %nose to i32 | ||
%nose.shift = lshr i64 %nose, 32 | ||
%nose.trunc.2 = trunc i64 %nose.shift to i32 | ||
%add = add nsw i32 %more, 1 | ||
ret i32 %add | ||
} | ||
|
||
!llvm.module.flags = !{!0, !1} | ||
!llvm.ident = !{!2} | ||
|
||
!0 = !{i32 1, !"wchar_size", i32 2} | ||
!1 = !{i32 7, !"PIC Level", i32 2} | ||
!2 = !{!"clang version 9.0.0 "} | ||
|
||
; CHECK: [[V1]] = !DILocalVariable( | ||
; CHECK: [[V2]] = !DILocalVariable( | ||
; CHECK: [[V3]] = !DILocalVariable( |
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
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