[llvm] [DebugInfo][SimplifyIndVar] Fix missing debug locations for div/rem instructions (PR #97284)

Sudharsan Veeravalli via llvm-commits llvm-commits at lists.llvm.org
Mon Jul 1 10:08:13 PDT 2024


================
@@ -0,0 +1,255 @@
+; Test that the debug information is propagated correctly to the new instructions
+; RUN: opt < %s -passes=indvars -S | FileCheck %s
+
+define void @test_srem_urem(ptr %a) !dbg !5 {
+; CHECK-LABEL: define void @test_srem_urem(
+; CHECK:    [[REM_UREM:%.*]] = urem i32 [[I_01:%.*]], 2, !dbg [[DBG20:![0-9]+]]
+; CHECK:      #dbg_value(i32 [[REM_UREM]], [[META11:![0-9]+]], !DIExpression(), [[DBG20]])
+;
+entry:
+  br label %for.body, !dbg !18
+
+for.body:                                         ; preds = %for.body, %entry
+  %i.01 = phi i32 [ 0, %entry ], [ %inc, %for.body ], !dbg !19
+  tail call void @llvm.dbg.value(metadata i32 %i.01, metadata !9, metadata !DIExpression()), !dbg !19
----------------
svs-quic wrote:

If these changes look okay and you have no further comments, could you please go ahead and merge this? I do not have commit access. Thanks.

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


More information about the llvm-commits mailing list