[llvm] 4f083c0 - [DebugInfo] Make tests SimplifyCFG-independent (NFC)
Nikita Popov via llvm-commits
llvm-commits at lists.llvm.org
Mon Aug 19 07:02:28 PDT 2024
Author: Nikita Popov
Date: 2024-08-19T16:00:46+02:00
New Revision: 4f083c0a2cb1d19942406f7e6e97ae47e8ac91b1
URL: https://github.com/llvm/llvm-project/commit/4f083c0a2cb1d19942406f7e6e97ae47e8ac91b1
DIFF: https://github.com/llvm/llvm-project/commit/4f083c0a2cb1d19942406f7e6e97ae47e8ac91b1.diff
LOG: [DebugInfo] Make tests SimplifyCFG-independent (NFC)
Run SimplifyCFG over the test input and disable the SimplifyCFG
run in the backend, so that these tests are not affected by changes
to SimplifyCFG.
Added:
Modified:
llvm/test/DebugInfo/COFF/AArch64/arm64-register-variables.ll
llvm/test/DebugInfo/COFF/ARMNT/arm-register-variables.ll
Removed:
################################################################################
diff --git a/llvm/test/DebugInfo/COFF/AArch64/arm64-register-variables.ll b/llvm/test/DebugInfo/COFF/AArch64/arm64-register-variables.ll
index 834e8f4ce7fed1..950594ed105d63 100644
--- a/llvm/test/DebugInfo/COFF/AArch64/arm64-register-variables.ll
+++ b/llvm/test/DebugInfo/COFF/AArch64/arm64-register-variables.ll
@@ -1,4 +1,4 @@
-; RUN: llc < %s -mtriple=arm64-windows -filetype=obj | llvm-readobj --codeview - | FileCheck %s --check-prefix=OBJ
+; RUN: llc < %s -mtriple=arm64-windows -filetype=obj -aarch64-enable-atomic-cfg-tidy=0 | llvm-readobj --codeview - | FileCheck %s --check-prefix=OBJ
; Generated from:
; volatile int x;
@@ -41,56 +41,50 @@ target triple = "arm64-unknown-windows-msvc19.16.27023"
@x = common dso_local global i32 0, align 4, !dbg !0
-; Function Attrs: noinline nounwind optnone uwtable
-define dso_local void @f(i32 %p) #0 !dbg !12 {
+define dso_local void @f(i32 %p) !dbg !11 {
entry:
%p.addr = alloca i32, align 4
%a = alloca i32, align 4
%b = alloca i32, align 4
%c = alloca i32, align 4
store i32 %p, ptr %p.addr, align 4
- call void @llvm.dbg.declare(metadata ptr %p.addr, metadata !15, metadata !DIExpression()), !dbg !16
- %0 = load i32, ptr %p.addr, align 4, !dbg !17
- %tobool = icmp ne i32 %0, 0, !dbg !17
- br i1 %tobool, label %if.then, label %if.else, !dbg !17
+ #dbg_declare(ptr %p.addr, !14, !DIExpression(), !15)
+ %0 = load i32, ptr %p.addr, align 4, !dbg !16
+ %tobool = icmp ne i32 %0, 0, !dbg !16
+ %call = call i32 @getint(), !dbg !17
+ br i1 %tobool, label %if.then, label %if.else, !dbg !16
if.then: ; preds = %entry
- call void @llvm.dbg.declare(metadata ptr %a, metadata !18, metadata !DIExpression()), !dbg !21
- %call = call i32 @getint(), !dbg !21
+ #dbg_declare(ptr %a, !19, !DIExpression(), !21)
store i32 %call, ptr %a, align 4, !dbg !21
- call void @llvm.dbg.declare(metadata ptr %b, metadata !22, metadata !DIExpression()), !dbg !23
+ #dbg_declare(ptr %b, !22, !DIExpression(), !23)
%1 = load i32, ptr %a, align 4, !dbg !23
%call1 = call i32 @inlineinc(i32 %1), !dbg !23
store i32 %call1, ptr %b, align 4, !dbg !23
%2 = load i32, ptr %b, align 4, !dbg !24
- call void @putint(i32 %2), !dbg !24
br label %if.end, !dbg !25
if.else: ; preds = %entry
- call void @llvm.dbg.declare(metadata ptr %c, metadata !26, metadata !DIExpression()), !dbg !28
- %call2 = call i32 @getint(), !dbg !28
- store i32 %call2, ptr %c, align 4, !dbg !28
+ #dbg_declare(ptr %c, !26, !DIExpression(), !28)
+ store i32 %call, ptr %c, align 4, !dbg !28
%3 = load i32, ptr %c, align 4, !dbg !29
- call void @putint(i32 %3), !dbg !29
br label %if.end, !dbg !30
if.end: ; preds = %if.else, %if.then
+ %.sink = phi i32 [ %3, %if.else ], [ %2, %if.then ]
+ call void @putint(i32 %.sink), !dbg !17
ret void, !dbg !31
}
-; Function Attrs: nounwind readnone speculatable
-declare void @llvm.dbg.declare(metadata, metadata, metadata) #1
+declare dso_local i32 @getint()
-declare dso_local i32 @getint() #2
-
-; Function Attrs: noinline nounwind optnone uwtable
-define internal i32 @inlineinc(i32 %a) #0 !dbg !32 {
+define internal i32 @inlineinc(i32 %a) !dbg !32 {
entry:
%a.addr = alloca i32, align 4
%b = alloca i32, align 4
store i32 %a, ptr %a.addr, align 4
- call void @llvm.dbg.declare(metadata ptr %a.addr, metadata !35, metadata !DIExpression()), !dbg !36
- call void @llvm.dbg.declare(metadata ptr %b, metadata !37, metadata !DIExpression()), !dbg !38
+ #dbg_declare(ptr %a.addr, !35, !DIExpression(), !36)
+ #dbg_declare(ptr %b, !37, !DIExpression(), !38)
%0 = load i32, ptr %a.addr, align 4, !dbg !38
%add = add nsw i32 %0, 1, !dbg !38
store i32 %add, ptr %b, align 4, !dbg !38
@@ -101,7 +95,7 @@ entry:
ret i32 %2, !dbg !40
}
-declare dso_local void @putint(i32) #2
+declare dso_local void @putint(i32)
!llvm.dbg.cu = !{!2}
!llvm.module.flags = !{!8, !9, !10}
@@ -109,7 +103,7 @@ declare dso_local void @putint(i32) #2
!0 = !DIGlobalVariableExpression(var: !1, expr: !DIExpression())
!1 = distinct !DIGlobalVariable(name: "x", scope: !2, file: !3, line: 1, type: !6, isLocal: false, isDefinition: true)
!2 = distinct !DICompileUnit(language: DW_LANG_C99, file: !3, producer: "clang version 9.0.0 (trunk 361867) (llvm/trunk 361866)", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug, enums: !4, globals: !5, nameTableKind: None)
-!3 = !DIFile(filename: "t.c", directory: "S:\5CLLVM\5Csvn\5Csbr\5Cbin", checksumkind: CSK_MD5, checksum: "734c448e95a6204a439a847ed063e5ce")
+!3 = !DIFile(filename: "t.c", directory: "S:\\LLVM\\svn\\sbr\\bin", checksumkind: CSK_MD5, checksum: "734c448e95a6204a439a847ed063e5ce")
!4 = !{}
!5 = !{!0}
!6 = !DIDerivedType(tag: DW_TAG_volatile_type, baseType: !7)
@@ -117,27 +111,27 @@ declare dso_local void @putint(i32) #2
!8 = !{i32 2, !"CodeView", i32 1}
!9 = !{i32 2, !"Debug Info Version", i32 3}
!10 = !{i32 1, !"wchar_size", i32 2}
-!11 = !{!"clang version 9.0.0 (trunk 361867) (llvm/trunk 361866)"}
-!12 = distinct !DISubprogram(name: "f", scope: !3, file: !3, line: 9, type: !13, scopeLine: 9, flags: DIFlagPrototyped, spFlags: DISPFlagDefinition, unit: !2, retainedNodes: !4)
-!13 = !DISubroutineType(types: !14)
-!14 = !{null, !7}
-!15 = !DILocalVariable(name: "p", arg: 1, scope: !12, file: !3, line: 9, type: !7)
-!16 = !DILocation(line: 9, scope: !12)
-!17 = !DILocation(line: 10, scope: !12)
-!18 = !DILocalVariable(name: "a", scope: !19, file: !3, line: 11, type: !7)
-!19 = distinct !DILexicalBlock(scope: !20, file: !3, line: 10)
-!20 = distinct !DILexicalBlock(scope: !12, file: !3, line: 10)
-!21 = !DILocation(line: 11, scope: !19)
-!22 = !DILocalVariable(name: "b", scope: !19, file: !3, line: 12, type: !7)
-!23 = !DILocation(line: 12, scope: !19)
-!24 = !DILocation(line: 13, scope: !19)
-!25 = !DILocation(line: 14, scope: !19)
+!11 = distinct !DISubprogram(name: "f", scope: !3, file: !3, line: 9, type: !12, scopeLine: 9, flags: DIFlagPrototyped, spFlags: DISPFlagDefinition, unit: !2, retainedNodes: !4)
+!12 = !DISubroutineType(types: !13)
+!13 = !{null, !7}
+!14 = !DILocalVariable(name: "p", arg: 1, scope: !11, file: !3, line: 9, type: !7)
+!15 = !DILocation(line: 9, scope: !11)
+!16 = !DILocation(line: 10, scope: !11)
+!17 = !DILocation(line: 0, scope: !18)
+!18 = distinct !DILexicalBlock(scope: !11, file: !3, line: 10)
+!19 = !DILocalVariable(name: "a", scope: !20, file: !3, line: 11, type: !7)
+!20 = distinct !DILexicalBlock(scope: !18, file: !3, line: 10)
+!21 = !DILocation(line: 11, scope: !20)
+!22 = !DILocalVariable(name: "b", scope: !20, file: !3, line: 12, type: !7)
+!23 = !DILocation(line: 12, scope: !20)
+!24 = !DILocation(line: 13, scope: !20)
+!25 = !DILocation(line: 14, scope: !20)
!26 = !DILocalVariable(name: "c", scope: !27, file: !3, line: 15, type: !7)
-!27 = distinct !DILexicalBlock(scope: !20, file: !3, line: 14)
+!27 = distinct !DILexicalBlock(scope: !18, file: !3, line: 14)
!28 = !DILocation(line: 15, scope: !27)
!29 = !DILocation(line: 16, scope: !27)
!30 = !DILocation(line: 17, scope: !27)
-!31 = !DILocation(line: 18, scope: !12)
+!31 = !DILocation(line: 18, scope: !11)
!32 = distinct !DISubprogram(name: "inlineinc", scope: !3, file: !3, line: 4, type: !33, scopeLine: 4, flags: DIFlagPrototyped, spFlags: DISPFlagLocalToUnit | DISPFlagDefinition, unit: !2, retainedNodes: !4)
!33 = !DISubroutineType(types: !34)
!34 = !{!7, !7}
diff --git a/llvm/test/DebugInfo/COFF/ARMNT/arm-register-variables.ll b/llvm/test/DebugInfo/COFF/ARMNT/arm-register-variables.ll
index 1eb8dff00e5893..079c14eeb3abf3 100644
--- a/llvm/test/DebugInfo/COFF/ARMNT/arm-register-variables.ll
+++ b/llvm/test/DebugInfo/COFF/ARMNT/arm-register-variables.ll
@@ -1,4 +1,4 @@
-; RUN: llc < %s -filetype=obj | llvm-readobj --codeview - | FileCheck %s --check-prefix=OBJ
+; RUN: llc < %s -filetype=obj -arm-atomic-cfg-tidy=0 | llvm-readobj --codeview - | FileCheck %s --check-prefix=OBJ
; Generated from:
@@ -57,7 +57,6 @@ target triple = "thumbv7-pc-windows-msvc19.11.0"
@x = dso_local global i32 0, align 4, !dbg !0
-; Function Attrs: noinline nounwind optnone
define dso_local arm_aapcs_vfpcc void @f(i32 %p) !dbg !14 {
entry:
%p.addr = alloca i32, align 4
@@ -65,56 +64,51 @@ entry:
%b = alloca i32, align 4
%c = alloca i32, align 4
store i32 %p, ptr %p.addr, align 4
- call void @llvm.dbg.declare(metadata ptr %p.addr, metadata !17, metadata !DIExpression()), !dbg !18
+ #dbg_declare(ptr %p.addr, !17, !DIExpression(), !18)
%0 = load i32, ptr %p.addr, align 4, !dbg !19
%tobool = icmp ne i32 %0, 0, !dbg !19
+ %call = call arm_aapcs_vfpcc i32 @getint(), !dbg !20
br i1 %tobool, label %if.then, label %if.else, !dbg !19
if.then: ; preds = %entry
- call void @llvm.dbg.declare(metadata ptr %a, metadata !20, metadata !DIExpression()), !dbg !23
- %call = call arm_aapcs_vfpcc i32 @getint(), !dbg !23
- store i32 %call, ptr %a, align 4, !dbg !23
- call void @llvm.dbg.declare(metadata ptr %b, metadata !24, metadata !DIExpression()), !dbg !25
- %1 = load i32, ptr %a, align 4, !dbg !25
- %call1 = call arm_aapcs_vfpcc i32 @inlineinc(i32 %1), !dbg !25
- store i32 %call1, ptr %b, align 4, !dbg !25
- %2 = load i32, ptr %b, align 4, !dbg !26
- call arm_aapcs_vfpcc void @putint(i32 %2), !dbg !26
- br label %if.end, !dbg !27
+ #dbg_declare(ptr %a, !22, !DIExpression(), !24)
+ store i32 %call, ptr %a, align 4, !dbg !24
+ #dbg_declare(ptr %b, !25, !DIExpression(), !26)
+ %1 = load i32, ptr %a, align 4, !dbg !26
+ %call1 = call arm_aapcs_vfpcc i32 @inlineinc(i32 %1), !dbg !26
+ store i32 %call1, ptr %b, align 4, !dbg !26
+ %2 = load i32, ptr %b, align 4, !dbg !27
+ br label %if.end, !dbg !28
if.else: ; preds = %entry
- call void @llvm.dbg.declare(metadata ptr %c, metadata !28, metadata !DIExpression()), !dbg !30
- %call2 = call arm_aapcs_vfpcc i32 @getint(), !dbg !30
- store i32 %call2, ptr %c, align 4, !dbg !30
- %3 = load i32, ptr %c, align 4, !dbg !31
- call arm_aapcs_vfpcc void @putint(i32 %3), !dbg !31
- br label %if.end, !dbg !32
+ #dbg_declare(ptr %c, !29, !DIExpression(), !31)
+ store i32 %call, ptr %c, align 4, !dbg !31
+ %3 = load i32, ptr %c, align 4, !dbg !32
+ br label %if.end, !dbg !33
if.end: ; preds = %if.else, %if.then
- ret void, !dbg !33
+ %.sink = phi i32 [ %3, %if.else ], [ %2, %if.then ]
+ call arm_aapcs_vfpcc void @putint(i32 %.sink), !dbg !20
+ ret void, !dbg !34
}
-; Function Attrs: nounwind readnone speculatable willreturn
-declare void @llvm.dbg.declare(metadata, metadata, metadata)
-
declare dso_local arm_aapcs_vfpcc i32 @getint()
-; Function Attrs: noinline nounwind optnone
-define internal arm_aapcs_vfpcc i32 @inlineinc(i32 %a) !dbg !34 {
+define internal arm_aapcs_vfpcc i32 @inlineinc(i32 %a) !dbg !35 {
entry:
%a.addr = alloca i32, align 4
%b = alloca i32, align 4
store i32 %a, ptr %a.addr, align 4
- call void @llvm.dbg.declare(metadata ptr %a.addr, metadata !37, metadata !DIExpression()), !dbg !38
- call void @llvm.dbg.declare(metadata ptr %b, metadata !39, metadata !DIExpression()), !dbg !40
- %0 = load i32, ptr %a.addr, align 4, !dbg !40
- %add = add nsw i32 %0, 1, !dbg !40
- store i32 %add, ptr %b, align 4, !dbg !40
- %1 = load volatile i32, ptr @x, align 4, !dbg !41
- %inc = add nsw i32 %1, 1, !dbg !41
- store volatile i32 %inc, ptr @x, align 4, !dbg !41
- %2 = load i32, ptr %b, align 4, !dbg !42
- ret i32 %2, !dbg !42
+ #dbg_declare(ptr %a.addr, !38, !DIExpression(), !39)
+ #dbg_declare(ptr %b, !40, !DIExpression(), !41)
+ %0 = load i32, ptr %a.addr, align 4, !dbg !41
+ %add = add nsw i32 %0, 1, !dbg !41
+ store i32 %add, ptr %b, align 4, !dbg !41
+ %1 = load volatile i32, ptr @x, align 4, !dbg !42
+ %inc = add nsw i32 %1, 1, !dbg !42
+ store volatile i32 %inc, ptr @x, align 4, !dbg !42
+ %2 = load i32, ptr %b, align 4, !dbg !43
+ ret i32 %2, !dbg !43
}
declare dso_local arm_aapcs_vfpcc void @putint(i32)
@@ -143,26 +137,27 @@ declare dso_local arm_aapcs_vfpcc void @putint(i32)
!17 = !DILocalVariable(name: "p", arg: 1, scope: !14, file: !6, line: 9, type: !8)
!18 = !DILocation(line: 9, scope: !14)
!19 = !DILocation(line: 10, scope: !14)
-!20 = !DILocalVariable(name: "a", scope: !21, file: !6, line: 11, type: !8)
-!21 = distinct !DILexicalBlock(scope: !22, file: !6, line: 10)
-!22 = distinct !DILexicalBlock(scope: !14, file: !6, line: 10)
-!23 = !DILocation(line: 11, scope: !21)
-!24 = !DILocalVariable(name: "b", scope: !21, file: !6, line: 12, type: !8)
-!25 = !DILocation(line: 12, scope: !21)
-!26 = !DILocation(line: 13, scope: !21)
-!27 = !DILocation(line: 14, scope: !21)
-!28 = !DILocalVariable(name: "c", scope: !29, file: !6, line: 15, type: !8)
-!29 = distinct !DILexicalBlock(scope: !22, file: !6, line: 14)
-!30 = !DILocation(line: 15, scope: !29)
-!31 = !DILocation(line: 16, scope: !29)
-!32 = !DILocation(line: 17, scope: !29)
-!33 = !DILocation(line: 18, scope: !14)
-!34 = distinct !DISubprogram(name: "inlineinc", scope: !6, file: !6, line: 4, type: !35, scopeLine: 4, flags: DIFlagPrototyped, spFlags: DISPFlagLocalToUnit | DISPFlagDefinition, unit: !2, retainedNodes: !4)
-!35 = !DISubroutineType(types: !36)
-!36 = !{!8, !8}
-!37 = !DILocalVariable(name: "a", arg: 1, scope: !34, file: !6, line: 4, type: !8)
-!38 = !DILocation(line: 4, scope: !34)
-!39 = !DILocalVariable(name: "b", scope: !34, file: !6, line: 5, type: !8)
-!40 = !DILocation(line: 5, scope: !34)
-!41 = !DILocation(line: 6, scope: !34)
-!42 = !DILocation(line: 7, scope: !34)
+!20 = !DILocation(line: 0, scope: !21)
+!21 = distinct !DILexicalBlock(scope: !14, file: !6, line: 10)
+!22 = !DILocalVariable(name: "a", scope: !23, file: !6, line: 11, type: !8)
+!23 = distinct !DILexicalBlock(scope: !21, file: !6, line: 10)
+!24 = !DILocation(line: 11, scope: !23)
+!25 = !DILocalVariable(name: "b", scope: !23, file: !6, line: 12, type: !8)
+!26 = !DILocation(line: 12, scope: !23)
+!27 = !DILocation(line: 13, scope: !23)
+!28 = !DILocation(line: 14, scope: !23)
+!29 = !DILocalVariable(name: "c", scope: !30, file: !6, line: 15, type: !8)
+!30 = distinct !DILexicalBlock(scope: !21, file: !6, line: 14)
+!31 = !DILocation(line: 15, scope: !30)
+!32 = !DILocation(line: 16, scope: !30)
+!33 = !DILocation(line: 17, scope: !30)
+!34 = !DILocation(line: 18, scope: !14)
+!35 = distinct !DISubprogram(name: "inlineinc", scope: !6, file: !6, line: 4, type: !36, scopeLine: 4, flags: DIFlagPrototyped, spFlags: DISPFlagLocalToUnit | DISPFlagDefinition, unit: !2, retainedNodes: !4)
+!36 = !DISubroutineType(types: !37)
+!37 = !{!8, !8}
+!38 = !DILocalVariable(name: "a", arg: 1, scope: !35, file: !6, line: 4, type: !8)
+!39 = !DILocation(line: 4, scope: !35)
+!40 = !DILocalVariable(name: "b", scope: !35, file: !6, line: 5, type: !8)
+!41 = !DILocation(line: 5, scope: !35)
+!42 = !DILocation(line: 6, scope: !35)
+!43 = !DILocation(line: 7, scope: !35)
More information about the llvm-commits
mailing list