[llvm] [DebugInfo][RemoveDIs] Final final test-maintenence patch (PR #80988)
Jeremy Morse via llvm-commits
llvm-commits at lists.llvm.org
Wed Feb 7 04:50:53 PST 2024
https://github.com/jmorse created https://github.com/llvm/llvm-project/pull/80988
This should be the final portion of shaping-up the test suite to be ready for turning on non-intrinsic debug-info:
* Pin CostModel tests that expect to see intrinsics in their -debug output to not use RemoveDIs. This is a spurious test output difference.
* Add 'tail' to a bunch of intrinsics in UpdateTestChecks. We're cannonicalising intrinsics to be printed with "tail" in RemoveDI conversion as dbg.values usually pick that up while being optimised. This is another spurious output difference.
* The "DebugInfoDrop" pass used in the debugify unit-tests happens to operate inside the pass manager, thus it sees non-intrinsic debug-info. Update it to correctly drop it.
>From 8bb5220ed3d44c531c18b1155ded293337572583 Mon Sep 17 00:00:00 2001
From: Jeremy Morse <jeremy.morse at sony.com>
Date: Wed, 7 Feb 2024 12:42:35 +0000
Subject: [PATCH] [DebugInfo][RemoveDIs] Final final test-maintenence patch
This should be the final portion of shaping-up the test suite to be ready
for turning on non-intrinsic debug-info:
* Pin CostModel tests that expect to see intrinsics in their -debug output
to not use RemoveDIs. This is a spurious test output difference.
* Add 'tail' to a bunch of intrinsics in UpdateTestChecks. We're
cannonicalising intrinsics to be printed with "tail" in RemoveDI
conversion as dbg.values usually pick that up while being optimised.
This is another spurious output difference.
* The "DebugInfoDrop" pass used in the debugify unit-tests happens to
operate inside the pass manager, thus it sees non-intrinsic debug-info.
Update it to correctly drop it.
---
.../Analysis/CostModel/X86/free-intrinsics.ll | 7 +++++--
.../CostModel/free-intrinsics-datalayout.ll | 7 +++++--
.../CostModel/free-intrinsics-no_info.ll | 7 +++++--
.../Inputs/various_ir_values.ll | 10 +++++-----
.../Inputs/various_ir_values.ll.expected | 20 +++++++++----------
.../various_ir_values.ll.funcsig.expected | 20 +++++++++----------
...ious_ir_values.ll.funcsig.globals.expected | 20 +++++++++----------
...us_ir_values.ll.funcsig.noglobals.expected | 20 +++++++++----------
...lues.ll.funcsig.transitiveglobals.expected | 20 +++++++++----------
.../Transforms/Utils/DebugifyTest.cpp | 2 ++
10 files changed, 72 insertions(+), 61 deletions(-)
diff --git a/llvm/test/Analysis/CostModel/X86/free-intrinsics.ll b/llvm/test/Analysis/CostModel/X86/free-intrinsics.ll
index 3c39e456eed5f9..1e9fd0df789229 100644
--- a/llvm/test/Analysis/CostModel/X86/free-intrinsics.ll
+++ b/llvm/test/Analysis/CostModel/X86/free-intrinsics.ll
@@ -1,6 +1,9 @@
; NOTE: Assertions have been autogenerated by utils/update_analyze_test_checks.py
-; RUN: opt -mtriple=x86_64-- -passes="print<cost-model>" 2>&1 -disable-output -cost-kind=code-size %s -S -o - | FileCheck %s --check-prefix=CHECK-SIZE
-; RUN: opt -mtriple=x86_64-- -passes="print<cost-model>" 2>&1 -disable-output -cost-kind=throughput %s -S -o - | FileCheck %s --check-prefix=CHECK-THROUGHPUT
+;; Pin this test to not use "RemoveDIs" non-intrinsic debug-info. We get the
+;; correct output in that mode, but it generates spurious test changes, so
+;; avoid that for the moment.
+; RUN: opt -mtriple=x86_64-- -passes="print<cost-model>" 2>&1 -disable-output -cost-kind=code-size %s -S -o - --experimental-debuginfo-iterators=false | FileCheck %s --check-prefix=CHECK-SIZE
+; RUN: opt -mtriple=x86_64-- -passes="print<cost-model>" 2>&1 -disable-output -cost-kind=throughput %s -S -o - --experimental-debuginfo-iterators=false | FileCheck %s --check-prefix=CHECK-THROUGHPUT
define i32 @trivially_free() {
; CHECK-SIZE-LABEL: 'trivially_free'
diff --git a/llvm/test/Analysis/CostModel/free-intrinsics-datalayout.ll b/llvm/test/Analysis/CostModel/free-intrinsics-datalayout.ll
index b5f204c2d9b26e..4ebb1e314ba183 100644
--- a/llvm/test/Analysis/CostModel/free-intrinsics-datalayout.ll
+++ b/llvm/test/Analysis/CostModel/free-intrinsics-datalayout.ll
@@ -1,6 +1,9 @@
; NOTE: Assertions have been autogenerated by utils/update_analyze_test_checks.py
-; RUN: opt -passes="print<cost-model>" 2>&1 -disable-output -cost-kind=code-size %s -S -o - | FileCheck %s --check-prefix=CHECK-SIZE
-; RUN: opt -passes="print<cost-model>" 2>&1 -disable-output -cost-kind=throughput %s -S -o - | FileCheck %s --check-prefix=CHECK-THROUGHPUT
+;; Pin this test to not use "RemoveDIs" non-intrinsic debug-info. We get the
+;; correct output in that mode, but it generates spurious test changes, so
+;; avoid that for the moment.
+; RUN: opt -passes="print<cost-model>" 2>&1 -disable-output -cost-kind=code-size %s -S -o - --experimental-debuginfo-iterators=false | FileCheck %s --check-prefix=CHECK-SIZE
+; RUN: opt -passes="print<cost-model>" 2>&1 -disable-output -cost-kind=throughput %s -S -o - --experimental-debuginfo-iterators=false | FileCheck %s --check-prefix=CHECK-THROUGHPUT
target datalayout = "e-m:e-i8:8:32-i16:16:32-i64:64-i128:128-n32:64-S128"
diff --git a/llvm/test/Analysis/CostModel/free-intrinsics-no_info.ll b/llvm/test/Analysis/CostModel/free-intrinsics-no_info.ll
index 5d4dcaa7cbe2f3..5d47e48944271f 100644
--- a/llvm/test/Analysis/CostModel/free-intrinsics-no_info.ll
+++ b/llvm/test/Analysis/CostModel/free-intrinsics-no_info.ll
@@ -1,6 +1,9 @@
; NOTE: Assertions have been autogenerated by utils/update_analyze_test_checks.py
-; RUN: opt -passes="print<cost-model>" 2>&1 -disable-output -cost-kind=code-size %s -S -o - | FileCheck %s --check-prefix=CHECK-SIZE
-; RUN: opt -passes="print<cost-model>" 2>&1 -disable-output -cost-kind=throughput %s -S -o - | FileCheck %s --check-prefix=CHECK-THROUGHPUT
+;; Pin this test to not use "RemoveDIs" non-intrinsic debug-info. We get the
+;; correct output in that mode, but it generates spurious test changes, so
+;; avoid that for the moment.
+; RUN: opt -passes="print<cost-model>" 2>&1 -disable-output -cost-kind=code-size %s -S -o - --experimental-debuginfo-iterators=false | FileCheck %s --check-prefix=CHECK-SIZE
+; RUN: opt -passes="print<cost-model>" 2>&1 -disable-output -cost-kind=throughput %s -S -o - --experimental-debuginfo-iterators=false | FileCheck %s --check-prefix=CHECK-THROUGHPUT
define i32 @trivially_free() {
; CHECK-SIZE-LABEL: 'trivially_free'
diff --git a/llvm/test/tools/UpdateTestChecks/update_test_checks/Inputs/various_ir_values.ll b/llvm/test/tools/UpdateTestChecks/update_test_checks/Inputs/various_ir_values.ll
index 60ad5583fbaea6..5ad61e3a007a7e 100644
--- a/llvm/test/tools/UpdateTestChecks/update_test_checks/Inputs/various_ir_values.ll
+++ b/llvm/test/tools/UpdateTestChecks/update_test_checks/Inputs/various_ir_values.ll
@@ -11,11 +11,11 @@ define dso_local void @foo(ptr %A) #0 !dbg !7 {
entry:
%A.addr = alloca ptr, align 8, !DIAssignID !62
%i = alloca i32, align 4
- call void @llvm.dbg.assign(metadata i1 undef, metadata !13, metadata !DIExpression(), metadata !62, metadata ptr %A.addr, metadata !DIExpression()), !dbg !20
+ tail call void @llvm.dbg.assign(metadata i1 undef, metadata !13, metadata !DIExpression(), metadata !62, metadata ptr %A.addr, metadata !DIExpression()), !dbg !20
store ptr %A, ptr %A.addr, align 8, !tbaa !16
- call void @llvm.dbg.declare(metadata ptr %A.addr, metadata !13, metadata !DIExpression()), !dbg !20
+ tail call void @llvm.dbg.declare(metadata ptr %A.addr, metadata !13, metadata !DIExpression()), !dbg !20
call void @llvm.lifetime.start.p0(i64 4, ptr %i) #3, !dbg !21
- call void @llvm.dbg.declare(metadata ptr %i, metadata !14, metadata !DIExpression()), !dbg !22
+ tail call void @llvm.dbg.declare(metadata ptr %i, metadata !14, metadata !DIExpression()), !dbg !22
store i32 0, ptr %i, align 4, !dbg !22, !tbaa !23
br label %for.cond, !dbg !21
@@ -63,9 +63,9 @@ entry:
%A.addr = alloca ptr, align 8
%i = alloca i32, align 4
store ptr %A, ptr %A.addr, align 8, !tbaa !16
- call void @llvm.dbg.declare(metadata ptr %A.addr, metadata !41, metadata !DIExpression()), !dbg !44
+ tail call void @llvm.dbg.declare(metadata ptr %A.addr, metadata !41, metadata !DIExpression()), !dbg !44
call void @llvm.lifetime.start.p0(i64 4, ptr %i) #3, !dbg !45
- call void @llvm.dbg.declare(metadata ptr %i, metadata !42, metadata !DIExpression()), !dbg !46
+ tail call void @llvm.dbg.declare(metadata ptr %i, metadata !42, metadata !DIExpression()), !dbg !46
store i32 0, ptr %i, align 4, !dbg !46, !tbaa !23
br label %for.cond, !dbg !45
diff --git a/llvm/test/tools/UpdateTestChecks/update_test_checks/Inputs/various_ir_values.ll.expected b/llvm/test/tools/UpdateTestChecks/update_test_checks/Inputs/various_ir_values.ll.expected
index 1ecb8b5dc53309..da58d0bf712e09 100644
--- a/llvm/test/tools/UpdateTestChecks/update_test_checks/Inputs/various_ir_values.ll.expected
+++ b/llvm/test/tools/UpdateTestChecks/update_test_checks/Inputs/various_ir_values.ll.expected
@@ -13,11 +13,11 @@ define dso_local void @foo(ptr %A) #0 !dbg !7 {
; CHECK-NEXT: entry:
; CHECK-NEXT: [[A_ADDR:%.*]] = alloca ptr, align 8, !DIAssignID [[DIASSIGNID16:![0-9]+]]
; CHECK-NEXT: [[I:%.*]] = alloca i32, align 4
-; CHECK-NEXT: call void @llvm.dbg.assign(metadata i1 undef, metadata [[META13:![0-9]+]], metadata !DIExpression(), metadata [[DIASSIGNID16]], metadata ptr [[A_ADDR]], metadata !DIExpression()), !dbg [[DBG17:![0-9]+]]
+; CHECK-NEXT: tail call void @llvm.dbg.assign(metadata i1 undef, metadata [[META13:![0-9]+]], metadata !DIExpression(), metadata [[DIASSIGNID16]], metadata ptr [[A_ADDR]], metadata !DIExpression()), !dbg [[DBG17:![0-9]+]]
; CHECK-NEXT: store ptr [[A:%.*]], ptr [[A_ADDR]], align 8, !tbaa [[TBAA18:![0-9]+]]
-; CHECK-NEXT: call void @llvm.dbg.declare(metadata ptr [[A_ADDR]], metadata [[META13]], metadata !DIExpression()), !dbg [[DBG17]]
+; CHECK-NEXT: tail call void @llvm.dbg.declare(metadata ptr [[A_ADDR]], metadata [[META13]], metadata !DIExpression()), !dbg [[DBG17]]
; CHECK-NEXT: call void @llvm.lifetime.start.p0(i64 4, ptr [[I]]) #[[ATTR3:[0-9]+]], !dbg [[DBG22:![0-9]+]]
-; CHECK-NEXT: call void @llvm.dbg.declare(metadata ptr [[I]], metadata [[META14:![0-9]+]], metadata !DIExpression()), !dbg [[DBG23:![0-9]+]]
+; CHECK-NEXT: tail call void @llvm.dbg.declare(metadata ptr [[I]], metadata [[META14:![0-9]+]], metadata !DIExpression()), !dbg [[DBG23:![0-9]+]]
; CHECK-NEXT: store i32 0, ptr [[I]], align 4, !dbg [[DBG23]], !tbaa [[TBAA24:![0-9]+]]
; CHECK-NEXT: br label [[FOR_COND:%.*]], !dbg [[DBG22]]
; CHECK: for.cond:
@@ -47,11 +47,11 @@ define dso_local void @foo(ptr %A) #0 !dbg !7 {
entry:
%A.addr = alloca ptr, align 8, !DIAssignID !62
%i = alloca i32, align 4
- call void @llvm.dbg.assign(metadata i1 undef, metadata !13, metadata !DIExpression(), metadata !62, metadata ptr %A.addr, metadata !DIExpression()), !dbg !20
+ tail call void @llvm.dbg.assign(metadata i1 undef, metadata !13, metadata !DIExpression(), metadata !62, metadata ptr %A.addr, metadata !DIExpression()), !dbg !20
store ptr %A, ptr %A.addr, align 8, !tbaa !16
- call void @llvm.dbg.declare(metadata ptr %A.addr, metadata !13, metadata !DIExpression()), !dbg !20
+ tail call void @llvm.dbg.declare(metadata ptr %A.addr, metadata !13, metadata !DIExpression()), !dbg !20
call void @llvm.lifetime.start.p0(i64 4, ptr %i) #3, !dbg !21
- call void @llvm.dbg.declare(metadata ptr %i, metadata !14, metadata !DIExpression()), !dbg !22
+ tail call void @llvm.dbg.declare(metadata ptr %i, metadata !14, metadata !DIExpression()), !dbg !22
store i32 0, ptr %i, align 4, !dbg !22, !tbaa !23
br label %for.cond, !dbg !21
@@ -100,9 +100,9 @@ define dso_local void @bar(ptr %A) #0 !dbg !39 {
; CHECK-NEXT: [[A_ADDR:%.*]] = alloca ptr, align 8
; CHECK-NEXT: [[I:%.*]] = alloca i32, align 4
; CHECK-NEXT: store ptr [[A:%.*]], ptr [[A_ADDR]], align 8, !tbaa [[TBAA18]]
-; CHECK-NEXT: call void @llvm.dbg.declare(metadata ptr [[A_ADDR]], metadata [[META43:![0-9]+]], metadata !DIExpression()), !dbg [[DBG46:![0-9]+]]
+; CHECK-NEXT: tail call void @llvm.dbg.declare(metadata ptr [[A_ADDR]], metadata [[META43:![0-9]+]], metadata !DIExpression()), !dbg [[DBG46:![0-9]+]]
; CHECK-NEXT: call void @llvm.lifetime.start.p0(i64 4, ptr [[I]]) #[[ATTR3]], !dbg [[DBG47:![0-9]+]]
-; CHECK-NEXT: call void @llvm.dbg.declare(metadata ptr [[I]], metadata [[META44:![0-9]+]], metadata !DIExpression()), !dbg [[DBG48:![0-9]+]]
+; CHECK-NEXT: tail call void @llvm.dbg.declare(metadata ptr [[I]], metadata [[META44:![0-9]+]], metadata !DIExpression()), !dbg [[DBG48:![0-9]+]]
; CHECK-NEXT: store i32 0, ptr [[I]], align 4, !dbg [[DBG48]], !tbaa [[TBAA24]]
; CHECK-NEXT: br label [[FOR_COND:%.*]], !dbg [[DBG47]]
; CHECK: for.cond:
@@ -133,9 +133,9 @@ entry:
%A.addr = alloca ptr, align 8
%i = alloca i32, align 4
store ptr %A, ptr %A.addr, align 8, !tbaa !16
- call void @llvm.dbg.declare(metadata ptr %A.addr, metadata !41, metadata !DIExpression()), !dbg !44
+ tail call void @llvm.dbg.declare(metadata ptr %A.addr, metadata !41, metadata !DIExpression()), !dbg !44
call void @llvm.lifetime.start.p0(i64 4, ptr %i) #3, !dbg !45
- call void @llvm.dbg.declare(metadata ptr %i, metadata !42, metadata !DIExpression()), !dbg !46
+ tail call void @llvm.dbg.declare(metadata ptr %i, metadata !42, metadata !DIExpression()), !dbg !46
store i32 0, ptr %i, align 4, !dbg !46, !tbaa !23
br label %for.cond, !dbg !45
diff --git a/llvm/test/tools/UpdateTestChecks/update_test_checks/Inputs/various_ir_values.ll.funcsig.expected b/llvm/test/tools/UpdateTestChecks/update_test_checks/Inputs/various_ir_values.ll.funcsig.expected
index d8ec5f3a77b937..66f8ce7602f4d0 100644
--- a/llvm/test/tools/UpdateTestChecks/update_test_checks/Inputs/various_ir_values.ll.funcsig.expected
+++ b/llvm/test/tools/UpdateTestChecks/update_test_checks/Inputs/various_ir_values.ll.funcsig.expected
@@ -14,11 +14,11 @@ define dso_local void @foo(ptr %A) #0 !dbg !7 {
; CHECK-NEXT: entry:
; CHECK-NEXT: [[A_ADDR:%.*]] = alloca ptr, align 8, !DIAssignID [[DIASSIGNID16:![0-9]+]]
; CHECK-NEXT: [[I:%.*]] = alloca i32, align 4
-; CHECK-NEXT: call void @llvm.dbg.assign(metadata i1 undef, metadata [[META13:![0-9]+]], metadata !DIExpression(), metadata [[DIASSIGNID16]], metadata ptr [[A_ADDR]], metadata !DIExpression()), !dbg [[DBG17:![0-9]+]]
+; CHECK-NEXT: tail call void @llvm.dbg.assign(metadata i1 undef, metadata [[META13:![0-9]+]], metadata !DIExpression(), metadata [[DIASSIGNID16]], metadata ptr [[A_ADDR]], metadata !DIExpression()), !dbg [[DBG17:![0-9]+]]
; CHECK-NEXT: store ptr [[A]], ptr [[A_ADDR]], align 8, !tbaa [[TBAA18:![0-9]+]]
-; CHECK-NEXT: call void @llvm.dbg.declare(metadata ptr [[A_ADDR]], metadata [[META13]], metadata !DIExpression()), !dbg [[DBG17]]
+; CHECK-NEXT: tail call void @llvm.dbg.declare(metadata ptr [[A_ADDR]], metadata [[META13]], metadata !DIExpression()), !dbg [[DBG17]]
; CHECK-NEXT: call void @llvm.lifetime.start.p0(i64 4, ptr [[I]]) #[[ATTR3:[0-9]+]], !dbg [[DBG22:![0-9]+]]
-; CHECK-NEXT: call void @llvm.dbg.declare(metadata ptr [[I]], metadata [[META14:![0-9]+]], metadata !DIExpression()), !dbg [[DBG23:![0-9]+]]
+; CHECK-NEXT: tail call void @llvm.dbg.declare(metadata ptr [[I]], metadata [[META14:![0-9]+]], metadata !DIExpression()), !dbg [[DBG23:![0-9]+]]
; CHECK-NEXT: store i32 0, ptr [[I]], align 4, !dbg [[DBG23]], !tbaa [[TBAA24:![0-9]+]]
; CHECK-NEXT: br label [[FOR_COND:%.*]], !dbg [[DBG22]]
; CHECK: for.cond:
@@ -48,11 +48,11 @@ define dso_local void @foo(ptr %A) #0 !dbg !7 {
entry:
%A.addr = alloca ptr, align 8, !DIAssignID !62
%i = alloca i32, align 4
- call void @llvm.dbg.assign(metadata i1 undef, metadata !13, metadata !DIExpression(), metadata !62, metadata ptr %A.addr, metadata !DIExpression()), !dbg !20
+ tail call void @llvm.dbg.assign(metadata i1 undef, metadata !13, metadata !DIExpression(), metadata !62, metadata ptr %A.addr, metadata !DIExpression()), !dbg !20
store ptr %A, ptr %A.addr, align 8, !tbaa !16
- call void @llvm.dbg.declare(metadata ptr %A.addr, metadata !13, metadata !DIExpression()), !dbg !20
+ tail call void @llvm.dbg.declare(metadata ptr %A.addr, metadata !13, metadata !DIExpression()), !dbg !20
call void @llvm.lifetime.start.p0(i64 4, ptr %i) #3, !dbg !21
- call void @llvm.dbg.declare(metadata ptr %i, metadata !14, metadata !DIExpression()), !dbg !22
+ tail call void @llvm.dbg.declare(metadata ptr %i, metadata !14, metadata !DIExpression()), !dbg !22
store i32 0, ptr %i, align 4, !dbg !22, !tbaa !23
br label %for.cond, !dbg !21
@@ -102,9 +102,9 @@ define dso_local void @bar(ptr %A) #0 !dbg !39 {
; CHECK-NEXT: [[A_ADDR:%.*]] = alloca ptr, align 8
; CHECK-NEXT: [[I:%.*]] = alloca i32, align 4
; CHECK-NEXT: store ptr [[A]], ptr [[A_ADDR]], align 8, !tbaa [[TBAA18]]
-; CHECK-NEXT: call void @llvm.dbg.declare(metadata ptr [[A_ADDR]], metadata [[META43:![0-9]+]], metadata !DIExpression()), !dbg [[DBG46:![0-9]+]]
+; CHECK-NEXT: tail call void @llvm.dbg.declare(metadata ptr [[A_ADDR]], metadata [[META43:![0-9]+]], metadata !DIExpression()), !dbg [[DBG46:![0-9]+]]
; CHECK-NEXT: call void @llvm.lifetime.start.p0(i64 4, ptr [[I]]) #[[ATTR3]], !dbg [[DBG47:![0-9]+]]
-; CHECK-NEXT: call void @llvm.dbg.declare(metadata ptr [[I]], metadata [[META44:![0-9]+]], metadata !DIExpression()), !dbg [[DBG48:![0-9]+]]
+; CHECK-NEXT: tail call void @llvm.dbg.declare(metadata ptr [[I]], metadata [[META44:![0-9]+]], metadata !DIExpression()), !dbg [[DBG48:![0-9]+]]
; CHECK-NEXT: store i32 0, ptr [[I]], align 4, !dbg [[DBG48]], !tbaa [[TBAA24]]
; CHECK-NEXT: br label [[FOR_COND:%.*]], !dbg [[DBG47]]
; CHECK: for.cond:
@@ -135,9 +135,9 @@ entry:
%A.addr = alloca ptr, align 8
%i = alloca i32, align 4
store ptr %A, ptr %A.addr, align 8, !tbaa !16
- call void @llvm.dbg.declare(metadata ptr %A.addr, metadata !41, metadata !DIExpression()), !dbg !44
+ tail call void @llvm.dbg.declare(metadata ptr %A.addr, metadata !41, metadata !DIExpression()), !dbg !44
call void @llvm.lifetime.start.p0(i64 4, ptr %i) #3, !dbg !45
- call void @llvm.dbg.declare(metadata ptr %i, metadata !42, metadata !DIExpression()), !dbg !46
+ tail call void @llvm.dbg.declare(metadata ptr %i, metadata !42, metadata !DIExpression()), !dbg !46
store i32 0, ptr %i, align 4, !dbg !46, !tbaa !23
br label %for.cond, !dbg !45
diff --git a/llvm/test/tools/UpdateTestChecks/update_test_checks/Inputs/various_ir_values.ll.funcsig.globals.expected b/llvm/test/tools/UpdateTestChecks/update_test_checks/Inputs/various_ir_values.ll.funcsig.globals.expected
index ea35ec593720e7..e52b93989c51b7 100644
--- a/llvm/test/tools/UpdateTestChecks/update_test_checks/Inputs/various_ir_values.ll.funcsig.globals.expected
+++ b/llvm/test/tools/UpdateTestChecks/update_test_checks/Inputs/various_ir_values.ll.funcsig.globals.expected
@@ -14,11 +14,11 @@ define dso_local void @foo(ptr %A) #0 !dbg !7 {
; CHECK-NEXT: entry:
; CHECK-NEXT: [[A_ADDR:%.*]] = alloca ptr, align 8, !DIAssignID [[DIASSIGNID16:![0-9]+]]
; CHECK-NEXT: [[I:%.*]] = alloca i32, align 4
-; CHECK-NEXT: call void @llvm.dbg.assign(metadata i1 undef, metadata [[META13:![0-9]+]], metadata !DIExpression(), metadata [[DIASSIGNID16]], metadata ptr [[A_ADDR]], metadata !DIExpression()), !dbg [[DBG17:![0-9]+]]
+; CHECK-NEXT: tail call void @llvm.dbg.assign(metadata i1 undef, metadata [[META13:![0-9]+]], metadata !DIExpression(), metadata [[DIASSIGNID16]], metadata ptr [[A_ADDR]], metadata !DIExpression()), !dbg [[DBG17:![0-9]+]]
; CHECK-NEXT: store ptr [[A]], ptr [[A_ADDR]], align 8, !tbaa [[TBAA18:![0-9]+]]
-; CHECK-NEXT: call void @llvm.dbg.declare(metadata ptr [[A_ADDR]], metadata [[META13]], metadata !DIExpression()), !dbg [[DBG17]]
+; CHECK-NEXT: tail call void @llvm.dbg.declare(metadata ptr [[A_ADDR]], metadata [[META13]], metadata !DIExpression()), !dbg [[DBG17]]
; CHECK-NEXT: call void @llvm.lifetime.start.p0(i64 4, ptr [[I]]) #[[ATTR3:[0-9]+]], !dbg [[DBG22:![0-9]+]]
-; CHECK-NEXT: call void @llvm.dbg.declare(metadata ptr [[I]], metadata [[META14:![0-9]+]], metadata !DIExpression()), !dbg [[DBG23:![0-9]+]]
+; CHECK-NEXT: tail call void @llvm.dbg.declare(metadata ptr [[I]], metadata [[META14:![0-9]+]], metadata !DIExpression()), !dbg [[DBG23:![0-9]+]]
; CHECK-NEXT: store i32 0, ptr [[I]], align 4, !dbg [[DBG23]], !tbaa [[TBAA24:![0-9]+]]
; CHECK-NEXT: br label [[FOR_COND:%.*]], !dbg [[DBG22]]
; CHECK: for.cond:
@@ -48,11 +48,11 @@ define dso_local void @foo(ptr %A) #0 !dbg !7 {
entry:
%A.addr = alloca ptr, align 8, !DIAssignID !62
%i = alloca i32, align 4
- call void @llvm.dbg.assign(metadata i1 undef, metadata !13, metadata !DIExpression(), metadata !62, metadata ptr %A.addr, metadata !DIExpression()), !dbg !20
+ tail call void @llvm.dbg.assign(metadata i1 undef, metadata !13, metadata !DIExpression(), metadata !62, metadata ptr %A.addr, metadata !DIExpression()), !dbg !20
store ptr %A, ptr %A.addr, align 8, !tbaa !16
- call void @llvm.dbg.declare(metadata ptr %A.addr, metadata !13, metadata !DIExpression()), !dbg !20
+ tail call void @llvm.dbg.declare(metadata ptr %A.addr, metadata !13, metadata !DIExpression()), !dbg !20
call void @llvm.lifetime.start.p0(i64 4, ptr %i) #3, !dbg !21
- call void @llvm.dbg.declare(metadata ptr %i, metadata !14, metadata !DIExpression()), !dbg !22
+ tail call void @llvm.dbg.declare(metadata ptr %i, metadata !14, metadata !DIExpression()), !dbg !22
store i32 0, ptr %i, align 4, !dbg !22, !tbaa !23
br label %for.cond, !dbg !21
@@ -102,9 +102,9 @@ define dso_local void @bar(ptr %A) #0 !dbg !39 {
; CHECK-NEXT: [[A_ADDR:%.*]] = alloca ptr, align 8
; CHECK-NEXT: [[I:%.*]] = alloca i32, align 4
; CHECK-NEXT: store ptr [[A]], ptr [[A_ADDR]], align 8, !tbaa [[TBAA18]]
-; CHECK-NEXT: call void @llvm.dbg.declare(metadata ptr [[A_ADDR]], metadata [[META43:![0-9]+]], metadata !DIExpression()), !dbg [[DBG46:![0-9]+]]
+; CHECK-NEXT: tail call void @llvm.dbg.declare(metadata ptr [[A_ADDR]], metadata [[META43:![0-9]+]], metadata !DIExpression()), !dbg [[DBG46:![0-9]+]]
; CHECK-NEXT: call void @llvm.lifetime.start.p0(i64 4, ptr [[I]]) #[[ATTR3]], !dbg [[DBG47:![0-9]+]]
-; CHECK-NEXT: call void @llvm.dbg.declare(metadata ptr [[I]], metadata [[META44:![0-9]+]], metadata !DIExpression()), !dbg [[DBG48:![0-9]+]]
+; CHECK-NEXT: tail call void @llvm.dbg.declare(metadata ptr [[I]], metadata [[META44:![0-9]+]], metadata !DIExpression()), !dbg [[DBG48:![0-9]+]]
; CHECK-NEXT: store i32 0, ptr [[I]], align 4, !dbg [[DBG48]], !tbaa [[TBAA24]]
; CHECK-NEXT: br label [[FOR_COND:%.*]], !dbg [[DBG47]]
; CHECK: for.cond:
@@ -135,9 +135,9 @@ entry:
%A.addr = alloca ptr, align 8
%i = alloca i32, align 4
store ptr %A, ptr %A.addr, align 8, !tbaa !16
- call void @llvm.dbg.declare(metadata ptr %A.addr, metadata !41, metadata !DIExpression()), !dbg !44
+ tail call void @llvm.dbg.declare(metadata ptr %A.addr, metadata !41, metadata !DIExpression()), !dbg !44
call void @llvm.lifetime.start.p0(i64 4, ptr %i) #3, !dbg !45
- call void @llvm.dbg.declare(metadata ptr %i, metadata !42, metadata !DIExpression()), !dbg !46
+ tail call void @llvm.dbg.declare(metadata ptr %i, metadata !42, metadata !DIExpression()), !dbg !46
store i32 0, ptr %i, align 4, !dbg !46, !tbaa !23
br label %for.cond, !dbg !45
diff --git a/llvm/test/tools/UpdateTestChecks/update_test_checks/Inputs/various_ir_values.ll.funcsig.noglobals.expected b/llvm/test/tools/UpdateTestChecks/update_test_checks/Inputs/various_ir_values.ll.funcsig.noglobals.expected
index 1ecb8b5dc53309..da58d0bf712e09 100644
--- a/llvm/test/tools/UpdateTestChecks/update_test_checks/Inputs/various_ir_values.ll.funcsig.noglobals.expected
+++ b/llvm/test/tools/UpdateTestChecks/update_test_checks/Inputs/various_ir_values.ll.funcsig.noglobals.expected
@@ -13,11 +13,11 @@ define dso_local void @foo(ptr %A) #0 !dbg !7 {
; CHECK-NEXT: entry:
; CHECK-NEXT: [[A_ADDR:%.*]] = alloca ptr, align 8, !DIAssignID [[DIASSIGNID16:![0-9]+]]
; CHECK-NEXT: [[I:%.*]] = alloca i32, align 4
-; CHECK-NEXT: call void @llvm.dbg.assign(metadata i1 undef, metadata [[META13:![0-9]+]], metadata !DIExpression(), metadata [[DIASSIGNID16]], metadata ptr [[A_ADDR]], metadata !DIExpression()), !dbg [[DBG17:![0-9]+]]
+; CHECK-NEXT: tail call void @llvm.dbg.assign(metadata i1 undef, metadata [[META13:![0-9]+]], metadata !DIExpression(), metadata [[DIASSIGNID16]], metadata ptr [[A_ADDR]], metadata !DIExpression()), !dbg [[DBG17:![0-9]+]]
; CHECK-NEXT: store ptr [[A:%.*]], ptr [[A_ADDR]], align 8, !tbaa [[TBAA18:![0-9]+]]
-; CHECK-NEXT: call void @llvm.dbg.declare(metadata ptr [[A_ADDR]], metadata [[META13]], metadata !DIExpression()), !dbg [[DBG17]]
+; CHECK-NEXT: tail call void @llvm.dbg.declare(metadata ptr [[A_ADDR]], metadata [[META13]], metadata !DIExpression()), !dbg [[DBG17]]
; CHECK-NEXT: call void @llvm.lifetime.start.p0(i64 4, ptr [[I]]) #[[ATTR3:[0-9]+]], !dbg [[DBG22:![0-9]+]]
-; CHECK-NEXT: call void @llvm.dbg.declare(metadata ptr [[I]], metadata [[META14:![0-9]+]], metadata !DIExpression()), !dbg [[DBG23:![0-9]+]]
+; CHECK-NEXT: tail call void @llvm.dbg.declare(metadata ptr [[I]], metadata [[META14:![0-9]+]], metadata !DIExpression()), !dbg [[DBG23:![0-9]+]]
; CHECK-NEXT: store i32 0, ptr [[I]], align 4, !dbg [[DBG23]], !tbaa [[TBAA24:![0-9]+]]
; CHECK-NEXT: br label [[FOR_COND:%.*]], !dbg [[DBG22]]
; CHECK: for.cond:
@@ -47,11 +47,11 @@ define dso_local void @foo(ptr %A) #0 !dbg !7 {
entry:
%A.addr = alloca ptr, align 8, !DIAssignID !62
%i = alloca i32, align 4
- call void @llvm.dbg.assign(metadata i1 undef, metadata !13, metadata !DIExpression(), metadata !62, metadata ptr %A.addr, metadata !DIExpression()), !dbg !20
+ tail call void @llvm.dbg.assign(metadata i1 undef, metadata !13, metadata !DIExpression(), metadata !62, metadata ptr %A.addr, metadata !DIExpression()), !dbg !20
store ptr %A, ptr %A.addr, align 8, !tbaa !16
- call void @llvm.dbg.declare(metadata ptr %A.addr, metadata !13, metadata !DIExpression()), !dbg !20
+ tail call void @llvm.dbg.declare(metadata ptr %A.addr, metadata !13, metadata !DIExpression()), !dbg !20
call void @llvm.lifetime.start.p0(i64 4, ptr %i) #3, !dbg !21
- call void @llvm.dbg.declare(metadata ptr %i, metadata !14, metadata !DIExpression()), !dbg !22
+ tail call void @llvm.dbg.declare(metadata ptr %i, metadata !14, metadata !DIExpression()), !dbg !22
store i32 0, ptr %i, align 4, !dbg !22, !tbaa !23
br label %for.cond, !dbg !21
@@ -100,9 +100,9 @@ define dso_local void @bar(ptr %A) #0 !dbg !39 {
; CHECK-NEXT: [[A_ADDR:%.*]] = alloca ptr, align 8
; CHECK-NEXT: [[I:%.*]] = alloca i32, align 4
; CHECK-NEXT: store ptr [[A:%.*]], ptr [[A_ADDR]], align 8, !tbaa [[TBAA18]]
-; CHECK-NEXT: call void @llvm.dbg.declare(metadata ptr [[A_ADDR]], metadata [[META43:![0-9]+]], metadata !DIExpression()), !dbg [[DBG46:![0-9]+]]
+; CHECK-NEXT: tail call void @llvm.dbg.declare(metadata ptr [[A_ADDR]], metadata [[META43:![0-9]+]], metadata !DIExpression()), !dbg [[DBG46:![0-9]+]]
; CHECK-NEXT: call void @llvm.lifetime.start.p0(i64 4, ptr [[I]]) #[[ATTR3]], !dbg [[DBG47:![0-9]+]]
-; CHECK-NEXT: call void @llvm.dbg.declare(metadata ptr [[I]], metadata [[META44:![0-9]+]], metadata !DIExpression()), !dbg [[DBG48:![0-9]+]]
+; CHECK-NEXT: tail call void @llvm.dbg.declare(metadata ptr [[I]], metadata [[META44:![0-9]+]], metadata !DIExpression()), !dbg [[DBG48:![0-9]+]]
; CHECK-NEXT: store i32 0, ptr [[I]], align 4, !dbg [[DBG48]], !tbaa [[TBAA24]]
; CHECK-NEXT: br label [[FOR_COND:%.*]], !dbg [[DBG47]]
; CHECK: for.cond:
@@ -133,9 +133,9 @@ entry:
%A.addr = alloca ptr, align 8
%i = alloca i32, align 4
store ptr %A, ptr %A.addr, align 8, !tbaa !16
- call void @llvm.dbg.declare(metadata ptr %A.addr, metadata !41, metadata !DIExpression()), !dbg !44
+ tail call void @llvm.dbg.declare(metadata ptr %A.addr, metadata !41, metadata !DIExpression()), !dbg !44
call void @llvm.lifetime.start.p0(i64 4, ptr %i) #3, !dbg !45
- call void @llvm.dbg.declare(metadata ptr %i, metadata !42, metadata !DIExpression()), !dbg !46
+ tail call void @llvm.dbg.declare(metadata ptr %i, metadata !42, metadata !DIExpression()), !dbg !46
store i32 0, ptr %i, align 4, !dbg !46, !tbaa !23
br label %for.cond, !dbg !45
diff --git a/llvm/test/tools/UpdateTestChecks/update_test_checks/Inputs/various_ir_values.ll.funcsig.transitiveglobals.expected b/llvm/test/tools/UpdateTestChecks/update_test_checks/Inputs/various_ir_values.ll.funcsig.transitiveglobals.expected
index 73d17052212e10..f7508bd1bbf61f 100644
--- a/llvm/test/tools/UpdateTestChecks/update_test_checks/Inputs/various_ir_values.ll.funcsig.transitiveglobals.expected
+++ b/llvm/test/tools/UpdateTestChecks/update_test_checks/Inputs/various_ir_values.ll.funcsig.transitiveglobals.expected
@@ -13,11 +13,11 @@ define dso_local void @foo(ptr %A) #0 !dbg !7 {
; CHECK-NEXT: entry:
; CHECK-NEXT: [[A_ADDR:%.*]] = alloca ptr, align 8, !DIAssignID [[DIASSIGNID16:![0-9]+]]
; CHECK-NEXT: [[I:%.*]] = alloca i32, align 4
-; CHECK-NEXT: call void @llvm.dbg.assign(metadata i1 undef, metadata [[META13:![0-9]+]], metadata !DIExpression(), metadata [[DIASSIGNID16]], metadata ptr [[A_ADDR]], metadata !DIExpression()), !dbg [[DBG17:![0-9]+]]
+; CHECK-NEXT: tail call void @llvm.dbg.assign(metadata i1 undef, metadata [[META13:![0-9]+]], metadata !DIExpression(), metadata [[DIASSIGNID16]], metadata ptr [[A_ADDR]], metadata !DIExpression()), !dbg [[DBG17:![0-9]+]]
; CHECK-NEXT: store ptr [[A:%.*]], ptr [[A_ADDR]], align 8, !tbaa [[TBAA18:![0-9]+]]
-; CHECK-NEXT: call void @llvm.dbg.declare(metadata ptr [[A_ADDR]], metadata [[META13]], metadata !DIExpression()), !dbg [[DBG17]]
+; CHECK-NEXT: tail call void @llvm.dbg.declare(metadata ptr [[A_ADDR]], metadata [[META13]], metadata !DIExpression()), !dbg [[DBG17]]
; CHECK-NEXT: call void @llvm.lifetime.start.p0(i64 4, ptr [[I]]) #[[ATTR3:[0-9]+]], !dbg [[DBG22:![0-9]+]]
-; CHECK-NEXT: call void @llvm.dbg.declare(metadata ptr [[I]], metadata [[META14:![0-9]+]], metadata !DIExpression()), !dbg [[DBG23:![0-9]+]]
+; CHECK-NEXT: tail call void @llvm.dbg.declare(metadata ptr [[I]], metadata [[META14:![0-9]+]], metadata !DIExpression()), !dbg [[DBG23:![0-9]+]]
; CHECK-NEXT: store i32 0, ptr [[I]], align 4, !dbg [[DBG23]], !tbaa [[TBAA24:![0-9]+]]
; CHECK-NEXT: br label [[FOR_COND:%.*]], !dbg [[DBG22]]
; CHECK: for.cond:
@@ -47,11 +47,11 @@ define dso_local void @foo(ptr %A) #0 !dbg !7 {
entry:
%A.addr = alloca ptr, align 8, !DIAssignID !62
%i = alloca i32, align 4
- call void @llvm.dbg.assign(metadata i1 undef, metadata !13, metadata !DIExpression(), metadata !62, metadata ptr %A.addr, metadata !DIExpression()), !dbg !20
+ tail call void @llvm.dbg.assign(metadata i1 undef, metadata !13, metadata !DIExpression(), metadata !62, metadata ptr %A.addr, metadata !DIExpression()), !dbg !20
store ptr %A, ptr %A.addr, align 8, !tbaa !16
- call void @llvm.dbg.declare(metadata ptr %A.addr, metadata !13, metadata !DIExpression()), !dbg !20
+ tail call void @llvm.dbg.declare(metadata ptr %A.addr, metadata !13, metadata !DIExpression()), !dbg !20
call void @llvm.lifetime.start.p0(i64 4, ptr %i) #3, !dbg !21
- call void @llvm.dbg.declare(metadata ptr %i, metadata !14, metadata !DIExpression()), !dbg !22
+ tail call void @llvm.dbg.declare(metadata ptr %i, metadata !14, metadata !DIExpression()), !dbg !22
store i32 0, ptr %i, align 4, !dbg !22, !tbaa !23
br label %for.cond, !dbg !21
@@ -100,9 +100,9 @@ define dso_local void @bar(ptr %A) #0 !dbg !39 {
; CHECK-NEXT: [[A_ADDR:%.*]] = alloca ptr, align 8
; CHECK-NEXT: [[I:%.*]] = alloca i32, align 4
; CHECK-NEXT: store ptr [[A:%.*]], ptr [[A_ADDR]], align 8, !tbaa [[TBAA18]]
-; CHECK-NEXT: call void @llvm.dbg.declare(metadata ptr [[A_ADDR]], metadata [[META43:![0-9]+]], metadata !DIExpression()), !dbg [[DBG46:![0-9]+]]
+; CHECK-NEXT: tail call void @llvm.dbg.declare(metadata ptr [[A_ADDR]], metadata [[META43:![0-9]+]], metadata !DIExpression()), !dbg [[DBG46:![0-9]+]]
; CHECK-NEXT: call void @llvm.lifetime.start.p0(i64 4, ptr [[I]]) #[[ATTR3]], !dbg [[DBG47:![0-9]+]]
-; CHECK-NEXT: call void @llvm.dbg.declare(metadata ptr [[I]], metadata [[META44:![0-9]+]], metadata !DIExpression()), !dbg [[DBG48:![0-9]+]]
+; CHECK-NEXT: tail call void @llvm.dbg.declare(metadata ptr [[I]], metadata [[META44:![0-9]+]], metadata !DIExpression()), !dbg [[DBG48:![0-9]+]]
; CHECK-NEXT: store i32 0, ptr [[I]], align 4, !dbg [[DBG48]], !tbaa [[TBAA24]]
; CHECK-NEXT: br label [[FOR_COND:%.*]], !dbg [[DBG47]]
; CHECK: for.cond:
@@ -133,9 +133,9 @@ entry:
%A.addr = alloca ptr, align 8
%i = alloca i32, align 4
store ptr %A, ptr %A.addr, align 8, !tbaa !16
- call void @llvm.dbg.declare(metadata ptr %A.addr, metadata !41, metadata !DIExpression()), !dbg !44
+ tail call void @llvm.dbg.declare(metadata ptr %A.addr, metadata !41, metadata !DIExpression()), !dbg !44
call void @llvm.lifetime.start.p0(i64 4, ptr %i) #3, !dbg !45
- call void @llvm.dbg.declare(metadata ptr %i, metadata !42, metadata !DIExpression()), !dbg !46
+ tail call void @llvm.dbg.declare(metadata ptr %i, metadata !42, metadata !DIExpression()), !dbg !46
store i32 0, ptr %i, align 4, !dbg !46, !tbaa !23
br label %for.cond, !dbg !45
diff --git a/llvm/unittests/Transforms/Utils/DebugifyTest.cpp b/llvm/unittests/Transforms/Utils/DebugifyTest.cpp
index 089830967e642e..1ec9402b8aa9c7 100644
--- a/llvm/unittests/Transforms/Utils/DebugifyTest.cpp
+++ b/llvm/unittests/Transforms/Utils/DebugifyTest.cpp
@@ -60,6 +60,8 @@ struct DebugValueDrop : public FunctionPass {
for (Instruction &I : BB) {
if (auto *DVI = dyn_cast<DbgVariableIntrinsic>(&I))
Dbgs.push_back(DVI);
+ // If there are any non-intrinsic records (DPValues), drop those too.
+ I.dropDbgValues();
}
}
More information about the llvm-commits
mailing list