Clean up the processing of dbg.value in various places
Summary:
First up is instcombine, where in the dbg.declare -> dbg.value conversion,
the llvm.dbg.value needs to be called on the actual loaded value, rather
than the address (since the whole point of this transformation is to be
able to get rid of the alloca). Further, now that that's cleaned up, we
can remove a hack in the backend, that would add an implicit OP_deref if
the argument to dbg.value was an alloca. This stems from before the
existence of DIExpression and is no longer necessary since the deref can
be expressed explicitly.
Now, in order to make sure that the tests pass with this change, we need to
correct the printing of DEBUG_VALUE comments to take into account the
expression, which wasn't taken into account before.
Unfortunately, for both these changes, there were a number of incorrect
test cases (mostly the wrong number of DW_OP_derefs, but also a couple
where the test itself was broken more badly). aprantl and I have gone
through and adjusted these test case in order to make them pass with
these fixes and in some cases to make sure they're actually testing
what they are meant to test.
Reviewers: aprantl
Subscribers: dsanders
Differential Revision: http://reviews.llvm.org/D14186
llvm-svn: 256077
2015-12-19 10:02:44 +08:00
|
|
|
; RUN: opt -instcombine -S < %s | FileCheck %s
|
|
|
|
target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"
|
|
|
|
target triple = "x86_64-pc-linux-gnu"
|
|
|
|
|
|
|
|
%foo = type { i64, i32, i32 }
|
|
|
|
|
|
|
|
; Function Attrs: nounwind readnone
|
|
|
|
declare void @llvm.dbg.declare(metadata, metadata, metadata) #0
|
|
|
|
declare void @llvm.dbg.value(metadata, i64, metadata, metadata) #0
|
|
|
|
|
|
|
|
; Function Attrs: sspreq
|
|
|
|
define void @julia_fastshortest_6256() #1 {
|
|
|
|
top:
|
|
|
|
%cp = alloca %foo, align 8
|
|
|
|
call void @llvm.dbg.declare(metadata %foo* %cp, metadata !1, metadata !16), !dbg !17
|
|
|
|
br i1 undef, label %idxend, label %fail
|
|
|
|
|
|
|
|
fail: ; preds = %top
|
|
|
|
unreachable
|
|
|
|
|
|
|
|
idxend: ; preds = %top
|
2016-04-12 02:15:44 +08:00
|
|
|
; CHECK-NOT call void @llvm.dbg.value(metadata %foo* %cp,
|
Clean up the processing of dbg.value in various places
Summary:
First up is instcombine, where in the dbg.declare -> dbg.value conversion,
the llvm.dbg.value needs to be called on the actual loaded value, rather
than the address (since the whole point of this transformation is to be
able to get rid of the alloca). Further, now that that's cleaned up, we
can remove a hack in the backend, that would add an implicit OP_deref if
the argument to dbg.value was an alloca. This stems from before the
existence of DIExpression and is no longer necessary since the deref can
be expressed explicitly.
Now, in order to make sure that the tests pass with this change, we need to
correct the printing of DEBUG_VALUE comments to take into account the
expression, which wasn't taken into account before.
Unfortunately, for both these changes, there were a number of incorrect
test cases (mostly the wrong number of DW_OP_derefs, but also a couple
where the test itself was broken more badly). aprantl and I have gone
through and adjusted these test case in order to make them pass with
these fixes and in some cases to make sure they're actually testing
what they are meant to test.
Reviewers: aprantl
Subscribers: dsanders
Differential Revision: http://reviews.llvm.org/D14186
llvm-svn: 256077
2015-12-19 10:02:44 +08:00
|
|
|
%0 = load volatile %foo, %foo* %cp, align 8
|
2016-04-12 02:15:44 +08:00
|
|
|
; CHECK: call void @llvm.dbg.value(metadata %foo %0,
|
Clean up the processing of dbg.value in various places
Summary:
First up is instcombine, where in the dbg.declare -> dbg.value conversion,
the llvm.dbg.value needs to be called on the actual loaded value, rather
than the address (since the whole point of this transformation is to be
able to get rid of the alloca). Further, now that that's cleaned up, we
can remove a hack in the backend, that would add an implicit OP_deref if
the argument to dbg.value was an alloca. This stems from before the
existence of DIExpression and is no longer necessary since the deref can
be expressed explicitly.
Now, in order to make sure that the tests pass with this change, we need to
correct the printing of DEBUG_VALUE comments to take into account the
expression, which wasn't taken into account before.
Unfortunately, for both these changes, there were a number of incorrect
test cases (mostly the wrong number of DW_OP_derefs, but also a couple
where the test itself was broken more badly). aprantl and I have gone
through and adjusted these test case in order to make them pass with
these fixes and in some cases to make sure they're actually testing
what they are meant to test.
Reviewers: aprantl
Subscribers: dsanders
Differential Revision: http://reviews.llvm.org/D14186
llvm-svn: 256077
2015-12-19 10:02:44 +08:00
|
|
|
store volatile %foo %0, %foo* undef, align 8
|
|
|
|
ret void
|
|
|
|
}
|
|
|
|
|
|
|
|
attributes #0 = { nounwind readnone }
|
|
|
|
attributes #1 = { sspreq }
|
|
|
|
|
|
|
|
!llvm.module.flags = !{!0}
|
2016-04-12 02:15:44 +08:00
|
|
|
!llvm.dbg.cu = !{!18}
|
Clean up the processing of dbg.value in various places
Summary:
First up is instcombine, where in the dbg.declare -> dbg.value conversion,
the llvm.dbg.value needs to be called on the actual loaded value, rather
than the address (since the whole point of this transformation is to be
able to get rid of the alloca). Further, now that that's cleaned up, we
can remove a hack in the backend, that would add an implicit OP_deref if
the argument to dbg.value was an alloca. This stems from before the
existence of DIExpression and is no longer necessary since the deref can
be expressed explicitly.
Now, in order to make sure that the tests pass with this change, we need to
correct the printing of DEBUG_VALUE comments to take into account the
expression, which wasn't taken into account before.
Unfortunately, for both these changes, there were a number of incorrect
test cases (mostly the wrong number of DW_OP_derefs, but also a couple
where the test itself was broken more badly). aprantl and I have gone
through and adjusted these test case in order to make them pass with
these fixes and in some cases to make sure they're actually testing
what they are meant to test.
Reviewers: aprantl
Subscribers: dsanders
Differential Revision: http://reviews.llvm.org/D14186
llvm-svn: 256077
2015-12-19 10:02:44 +08:00
|
|
|
|
|
|
|
!0 = !{i32 1, !"Debug Info Version", i32 3}
|
|
|
|
!1 = !DILocalVariable(name: "cp", scope: !2, file: !3, line: 106, type: !12)
|
2016-04-15 23:57:41 +08:00
|
|
|
!2 = distinct !DISubprogram(name: "fastshortest", linkageName: "julia_fastshortest_6256", scope: null, file: !3, type: !4, isLocal: false, isDefinition: true, isOptimized: true, unit: !18, variables: !11)
|
Clean up the processing of dbg.value in various places
Summary:
First up is instcombine, where in the dbg.declare -> dbg.value conversion,
the llvm.dbg.value needs to be called on the actual loaded value, rather
than the address (since the whole point of this transformation is to be
able to get rid of the alloca). Further, now that that's cleaned up, we
can remove a hack in the backend, that would add an implicit OP_deref if
the argument to dbg.value was an alloca. This stems from before the
existence of DIExpression and is no longer necessary since the deref can
be expressed explicitly.
Now, in order to make sure that the tests pass with this change, we need to
correct the printing of DEBUG_VALUE comments to take into account the
expression, which wasn't taken into account before.
Unfortunately, for both these changes, there were a number of incorrect
test cases (mostly the wrong number of DW_OP_derefs, but also a couple
where the test itself was broken more badly). aprantl and I have gone
through and adjusted these test case in order to make them pass with
these fixes and in some cases to make sure they're actually testing
what they are meant to test.
Reviewers: aprantl
Subscribers: dsanders
Differential Revision: http://reviews.llvm.org/D14186
llvm-svn: 256077
2015-12-19 10:02:44 +08:00
|
|
|
!3 = !DIFile(filename: "grisu/fastshortest.jl", directory: ".")
|
|
|
|
!4 = !DISubroutineType(types: !5)
|
|
|
|
!5 = !{!6, !7}
|
|
|
|
!6 = !DIBasicType(name: "Float64", size: 64, align: 64, encoding: DW_ATE_unsigned)
|
|
|
|
!7 = !DIDerivedType(tag: DW_TAG_pointer_type, baseType: !8, size: 64, align: 64)
|
|
|
|
!8 = !DICompositeType(tag: DW_TAG_structure_type, name: "jl_value_t", file: !9, line: 71, align: 64, elements: !10)
|
|
|
|
!9 = !DIFile(filename: "julia.h", directory: "")
|
|
|
|
!10 = !{!7}
|
|
|
|
!11 = !{}
|
|
|
|
!12 = !DICompositeType(tag: DW_TAG_structure_type, name: "Float", size: 128, align: 64, elements: !13, runtimeLang: DW_LANG_Julia)
|
|
|
|
!13 = !{!14, !15, !15}
|
|
|
|
!14 = !DIBasicType(name: "UInt64", size: 64, align: 64, encoding: DW_ATE_unsigned)
|
|
|
|
!15 = !DIBasicType(name: "Int32", size: 32, align: 32, encoding: DW_ATE_unsigned)
|
|
|
|
!16 = !DIExpression()
|
|
|
|
!17 = !DILocation(line: 106, scope: !2)
|
2016-04-15 23:57:41 +08:00
|
|
|
!18 = distinct !DICompileUnit(language: DW_LANG_Julia, file: !3)
|