[llvm] [DebugInfo][IndVarSimplify] fix missing debug location updates (PR #91443)

Shan Huang via llvm-commits llvm-commits at lists.llvm.org
Wed May 8 06:54:56 PDT 2024


================
@@ -0,0 +1,65 @@
+; RUN: opt < %s -passes=indvars -S | FileCheck %s
+
+; This testcase checks the preservation of debug locations of newly created 
+; phi, sitofp, add and icmp instructions in IndVarSimplify Pass.
+
+define void @test1() !dbg !5 {
+; CHECK-LABEL: @test1(
+; CHECK-NEXT:  entry:
+; CHECK-NEXT:    br label [[BB:%.*]], !dbg
+; CHECK:  bb:
+; CHECK:    [[IV_INT:%.*]] = phi i32 [ 0, [[ENTRY:%.*]] ], [ [[DOTINT:%.*]], [[BB]] ], !dbg
+; CHECK:    [[INDVAR_CONV:%.*]] = sitofp i32 [[IV_INT]] to double, !dbg
+; CHECK:    [[DOTINT]] = add nuw nsw i32 [[IV_INT]], 1, !dbg
+; CHECK:    [[TMP1:%.*]] = icmp ult i32 [[DOTINT]], 10000, !dbg
----------------
Apochens wrote:

Ok, the checks are refined!

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


More information about the llvm-commits mailing list