aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--lib/Transforms/Utils/PromoteMemoryToRegister.cpp6
-rw-r--r--test/Transforms/Mem2Reg/ConvertDebugInfo.ll2
-rw-r--r--test/Transforms/Mem2Reg/ConvertDebugInfo2.ll2
3 files changed, 4 insertions, 6 deletions
diff --git a/lib/Transforms/Utils/PromoteMemoryToRegister.cpp b/lib/Transforms/Utils/PromoteMemoryToRegister.cpp
index 87d0a10..02eae5b 100644
--- a/lib/Transforms/Utils/PromoteMemoryToRegister.cpp
+++ b/lib/Transforms/Utils/PromoteMemoryToRegister.cpp
@@ -897,10 +897,8 @@ void PromoteMem2Reg::ConvertDebugDeclareToDebugValue(DbgDeclareInst *DDI,
// Propagate any debug metadata from the store onto the dbg.value.
if (MDNode *SIMD = SI->getMetadata("dbg"))
DbgVal->setMetadata("dbg", SIMD);
- // Otherwise propagate debug metadata from dbg.declare for inlined fn args.
- else if (!DISubprogram(DIVar.getContext()).
- describes(DDI->getParent()->getParent()))
- if (MDNode *MD = DDI->getMetadata("dbg"))
+ // Otherwise propagate debug metadata from dbg.declare.
+ else if (MDNode *MD = DDI->getMetadata("dbg"))
DbgVal->setMetadata("dbg", MD);
}
diff --git a/test/Transforms/Mem2Reg/ConvertDebugInfo.ll b/test/Transforms/Mem2Reg/ConvertDebugInfo.ll
index 37d27d4..2f1ccb4 100644
--- a/test/Transforms/Mem2Reg/ConvertDebugInfo.ll
+++ b/test/Transforms/Mem2Reg/ConvertDebugInfo.ll
@@ -9,7 +9,7 @@ entry:
%"alloca point" = bitcast i32 0 to i32 ; <i32> [#uses=0]
call void @llvm.dbg.declare(metadata !{i32* %i_addr}, metadata !0), !dbg !8
; CHECK: call void @llvm.dbg.value(metadata !{i32 %i}, i64 0, metadata !0)
-; CHECK: call void @llvm.dbg.value(metadata !{double %j}, i64 0, metadata !8)
+; CHECK: call void @llvm.dbg.value(metadata !{double %j}, i64 0, metadata !9)
store i32 %i, i32* %i_addr
call void @llvm.dbg.declare(metadata !{double* %j_addr}, metadata !9), !dbg !8
store double %j, double* %j_addr
diff --git a/test/Transforms/Mem2Reg/ConvertDebugInfo2.ll b/test/Transforms/Mem2Reg/ConvertDebugInfo2.ll
index e637a0f..4cb621f 100644
--- a/test/Transforms/Mem2Reg/ConvertDebugInfo2.ll
+++ b/test/Transforms/Mem2Reg/ConvertDebugInfo2.ll
@@ -1,4 +1,4 @@
-; RUN: opt -mem2reg < %s | llvm-dis | grep ".dbg " | count 6
+; RUN: opt -mem2reg < %s | llvm-dis | grep ".dbg " | count 7
declare void @llvm.dbg.declare(metadata, metadata) nounwind readnone