[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)
commit49f3c2b604853c3dc2c2b72568089a046e8b9204
tree7777d899e6613c1334b2ba3ecd1f278bb0095374
parent75c57b587d4f63486b2280df9ee37be8065a7353
[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

llvm-svn: 372703
llvm/lib/Transforms/Scalar/IndVarSimplify.cpp
llvm/test/Transforms/IndVarSimplify/indvar-debug-value.ll [new file with mode: 0644]
llvm/test/Transforms/IndVarSimplify/indvar-debug-value2.ll [new file with mode: 0644]