[PATCH] D44356: [LICM] Salvage DebugInfo from dying Instructions

Anastasis via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Mar 13 08:11:51 PDT 2018


gramanas updated this revision to Diff 138197.
gramanas marked 4 inline comments as done.
gramanas retitled this revision from "[LICM] Salvage DebugInfo from dying Instructions " to "[LICM] Salvage DebugInfo from dying Instructions".
gramanas edited the summary of this revision.
gramanas added a comment.

- fix redundant debugify test


Repository:
  rL LLVM

https://reviews.llvm.org/D44356

Files:
  lib/Transforms/Scalar/LICM.cpp
  test/Transforms/LICM/sinking.ll


Index: test/Transforms/LICM/sinking.ll
===================================================================
--- test/Transforms/LICM/sinking.ll
+++ test/Transforms/LICM/sinking.ll
@@ -1,4 +1,5 @@
 ; RUN: opt < %s -basicaa -licm -S | FileCheck %s
+; RUN: opt < %s -debugify -basicaa -licm -S | FileCheck %s -check-prefix=DEBUGIFY
 
 declare i32 @strlen(i8*) readonly nounwind
 
@@ -249,6 +250,9 @@
 ; CHECK-LABEL: @test11(
 ; CHECK:     Out:
 ; CHECK-NEXT:  ret void
+
+; DEBUGIFY-LABEL: @PR18753(
+; DEBUGIFY:    call void @llvm.dbg.value(metadata i32 %l.le, metadata {{.*}}, metadata !DIExpression())
 }
 
 @c = common global [1 x i32] zeroinitializer, align 4
Index: lib/Transforms/Scalar/LICM.cpp
===================================================================
--- lib/Transforms/Scalar/LICM.cpp
+++ lib/Transforms/Scalar/LICM.cpp
@@ -393,6 +393,7 @@
       // used in the loop, instead, just delete it.
       if (isInstructionTriviallyDead(&I, TLI)) {
         DEBUG(dbgs() << "LICM deleting dead inst: " << I << '\n');
+        salvageDebugInfo(I);
         ++II;
         CurAST->deleteValue(&I);
         I.eraseFromParent();


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D44356.138197.patch
Type: text/x-patch
Size: 1137 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20180313/9059bc11/attachment.bin>


More information about the llvm-commits mailing list