[llvm] [DebugInfo][RemoveDIs] Instrument jump-threading to update DPValues (PR #73127)

Orlando Cazalet-Hyams via llvm-commits llvm-commits at lists.llvm.org
Thu Nov 23 06:09:34 PST 2023


================
@@ -91,6 +92,47 @@ exit:                                             ; preds = %bb.f4, %bb.f3, %bb.
   ret void, !dbg !29
 }
 
+; Test for the cloning of dbg.values on elided instructions -- down one path
+; being threaded, the and in the function below is optimised away, but it's
+; debug-info should still be preserved.
+; Similarly, the call to f1 gets cloned, it's dbg.value should be cloned too.
+define void @test16(i1 %c, i1 %c2, i1 %c3, i1 %c4) nounwind ssp !dbg !30 {
+; CHECK-LABEL: define void @test16(i1
+entry:
+  %cmp = icmp sgt i32 undef, 1, !dbg !33
+  br i1 %c, label %land.end, label %land.rhs, !dbg !33
+
+land.rhs:
+  br i1 %c2, label %lor.lhs.false.i, label %land.end, !dbg !33
+
+lor.lhs.false.i:
+  br i1 %c3, label %land.end, label %land.end, !dbg !33
+
+; CHECK-LABEL: land.end.thr_comm:
+; CHECK-NEXT:  call void @llvm.dbg.value(metadata i32 0,
----------------
OCHyams wrote:

Can you give the dbg.values different constant values to easily identify which is which in the output/CHECK lines?

https://github.com/llvm/llvm-project/pull/73127


More information about the llvm-commits mailing list