[Debuginfo] dbg.value points to undef value after Induction Variable Simplification.
authorAlexey Lapshin <a.v.lapshin@mail.ru>
Tue, 24 Sep 2019 08:47:03 +0000 (08:47 +0000)
committerAlexey Lapshin <a.v.lapshin@mail.ru>
Tue, 24 Sep 2019 08:47:03 +0000 (08:47 +0000)
commit70343be0311866c25806934b3a813454b5215f8c
tree5e5ad1a4e91f444f5be021a942c472c8a13a9466
parentc2d414b4dae34254b3e02176ca4fb5c9c36b692f
[Debuginfo] dbg.value points to undef value after Induction Variable Simplification.

Induction Variable Simplification pass does not update dbg.value intrinsic.

Before:

%add = add nuw nsw i32 %ArgIndex.06, 1
call void @llvm.dbg.value(metadata i32 %add, metadata !17, metadata !DIExpression())

After:

%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
call void @llvm.dbg.value(metadata i64 undef, metadata !17, metadata !DIExpression())

There should be:

%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
call void @llvm.dbg.value(metadata i64 %indvars.iv.next, metadata !17, metadata !DIExpression())

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@372703 91177308-0d34-0410-b5e6-96231b3b80d8
lib/Transforms/Scalar/IndVarSimplify.cpp
test/Transforms/IndVarSimplify/indvar-debug-value.ll [new file with mode: 0644]
test/Transforms/IndVarSimplify/indvar-debug-value2.ll [new file with mode: 0644]