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

Vedant Kumar via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Mar 12 16:28:36 PDT 2018


vsk added inline comments.


================
Comment at: test/Transforms/LICM/sinking.ll:314
 ; CHECK-NEXT:    %l.le = trunc i64 %[[LCSSAPHI]] to i32
-; CHECK-NEXT:    ret i32 %l.le
+; DEBUGIFY:    call void @llvm.dbg.value(metadata i32 %l.le, metadata !143, metadata !DIExpression())
+; CHECK:    ret i32 %l.le
----------------
vsk wrote:
> Generally we try not to hardcode metadata numbers into CHECK lines, because it can make for a brittle test case. We wouldn't want this test to fail if e.g the order in which metadata are emitted changes.
> 
> Instead of "!143", writing "{{.*}}" here would be fine.
When testing this patch out locally, I found that only dbg.value salvaged in sinking.ll is in the function @test11. In that function, there's a dead getelementptr instruction which LICM deletes. Right before it goes away, the call you added to salvageDebugInfo() rewrites the effect of the GEP as a DIExpression:

call void @llvm.dbg.value(metadata %Ty* @X2, metadata !127, metadata !DIExpression(DW_OP_stack_value))

Could you remove the changes to the @PR18753 function, and add checks to @test11 instead?


Repository:
  rL LLVM

https://reviews.llvm.org/D44356





More information about the llvm-commits mailing list