[PATCH] D67770: [Debuginfo] dbg.value points to undef value after Induction Variable Simplification.

Alexey Lapshin via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Sep 19 10:30:20 PDT 2019


avl created this revision.
avl added reviewers: aprantl, jmorse, vsk.
avl added projects: LLVM, debug-info.
Herald added a subscriber: hiraditya.

  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 i32 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())
  
  The fix is to reattach dbg.value to the clone instruction created in widenIVUse()


https://reviews.llvm.org/D67770

Files:
  llvm/include/llvm/Transforms/Utils/Local.h
  llvm/lib/Transforms/Scalar/IndVarSimplify.cpp
  llvm/lib/Transforms/Utils/Local.cpp
  llvm/test/Transforms/IndVarSimplify/indvar-debug-value.ll
  llvm/test/Transforms/IndVarSimplify/indvar-debug-value2.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D67770.220883.patch
Type: text/x-patch
Size: 11965 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20190919/c1a12de1/attachment.bin>


More information about the llvm-commits mailing list