[llvm] 23ee84f - [globalisel] Add test case for regbank selection.

via llvm-commits llvm-commits at lists.llvm.org
Sat Jul 2 02:15:24 PDT 2022


Author: Luo, Yuanke
Date: 2022-07-02T17:06:00+08:00
New Revision: 23ee84f43201948557d58d4761add84772c1cee1

URL: https://github.com/llvm/llvm-project/commit/23ee84f43201948557d58d4761add84772c1cee1
DIFF: https://github.com/llvm/llvm-project/commit/23ee84f43201948557d58d4761add84772c1cee1.diff

LOG: [globalisel] Add test case for regbank selection.

Added: 
    llvm/test/DebugInfo/AArch64/debug-reg-bank.ll
    llvm/test/DebugInfo/X86/debug-reg-bank.ll

Modified: 
    

Removed: 
    


################################################################################
diff  --git a/llvm/test/DebugInfo/AArch64/debug-reg-bank.ll b/llvm/test/DebugInfo/AArch64/debug-reg-bank.ll
new file mode 100644
index 0000000000000..72316c2b1ae2f
--- /dev/null
+++ b/llvm/test/DebugInfo/AArch64/debug-reg-bank.ll
@@ -0,0 +1,43 @@
+; NOTE: Assertions have been autogenerated by utils/update_mir_test_checks.py
+; RUN: llc < %s -mtriple=aarch64-linux-gnu -O0 -global-isel -stop-after instruction-select | FileCheck %s
+
+define void @foo(i32 %n) !dbg !7 {
+  ; CHECK-LABEL: name: foo
+  ; CHECK: bb.1.entry:
+  ; CHECK-NEXT:   liveins: $w0
+  ; CHECK-NEXT: {{  $}}
+  ; CHECK-NEXT:   DBG_VALUE %0:_, $noreg, !12, !DIExpression(), debug-location !19
+  ; CHECK-NEXT:   RET_ReallyLR debug-location !20
+entry:
+  call void @llvm.dbg.value(metadata i32 %n, i64 0, metadata !12, metadata !19), !dbg !20
+  ret void, !dbg !21
+}
+
+declare void @llvm.dbg.value(metadata, i64, metadata, metadata)
+
+!llvm.dbg.cu = !{!0}
+!llvm.module.flags = !{!3, !4, !5}
+!llvm.ident = !{!6}
+
+!0 = distinct !DICompileUnit(language: DW_LANG_C99, file: !1, producer: "clang version 5.0.1", isOptimized: true, runtimeVersion: 0, emissionKind: FullDebug, enums: !2)
+!1 = !DIFile(filename: "vla.c", directory: "/path/to")
+!2 = !{}
+!3 = !{i32 2, !"Dwarf Version", i32 4}
+!4 = !{i32 2, !"Debug Info Version", i32 3}
+!5 = !{i32 1, !"wchar_size", i32 4}
+!6 = !{!"clang version 5.0.1"}
+!7 = distinct !DISubprogram(name: "foo", scope: !1, file: !1, line: 20, type: !8, isLocal: false, isDefinition: true, scopeLine: 20, flags: DIFlagPrototyped, isOptimized: true, unit: !0, retainedNodes: !11)
+!8 = !DISubroutineType(types: !9)
+!9 = !{null, !10}
+!10 = !DIBasicType(name: "int", size: 32, encoding: DW_ATE_signed)
+!11 = !{!12, !13, !15}
+!12 = !DILocalVariable(name: "n", arg: 1, scope: !7, file: !1, line: 20, type: !10)
+!13 = !DILocalVariable(name: "vla_expr", scope: !7, file: !1, line: 21, type: !14)
+!14 = !DIBasicType(name: "long unsigned int", size: 64, encoding: DW_ATE_unsigned)
+!15 = !DILocalVariable(name: "vla", scope: !7, file: !1, line: 21, type: !16)
+!16 = !DICompositeType(tag: DW_TAG_array_type, baseType: !10, align: 32, elements: !17)
+!17 = !{!18, !18}
+!18 = !DISubrange(count: !13)
+!19 = !DIExpression()
+!20 = !DILocation(line: 20, column: 14, scope: !7)
+!21 = !DILocation(line: 22, column: 1, scope: !7)

diff  --git a/llvm/test/DebugInfo/X86/debug-reg-bank.ll b/llvm/test/DebugInfo/X86/debug-reg-bank.ll
new file mode 100644
index 0000000000000..7e84baf329c64
--- /dev/null
+++ b/llvm/test/DebugInfo/X86/debug-reg-bank.ll
@@ -0,0 +1,43 @@
+; NOTE: Assertions have been autogenerated by utils/update_mir_test_checks.py
+; RUN: llc < %s -mtriple=x86_64-linux-gnu -O0 -global-isel -stop-after instruction-select | FileCheck %s
+
+define void @foo(i32 %n) !dbg !7 {
+  ; CHECK-LABEL: name: foo
+  ; CHECK: bb.1.entry:
+  ; CHECK-NEXT:   liveins: $edi
+  ; CHECK-NEXT: {{  $}}
+  ; CHECK-NEXT:   DBG_VALUE %0:gpr, $noreg, !12, !DIExpression(), debug-location !19
+  ; CHECK-NEXT:   RET 0, debug-location !20
+entry:
+  call void @llvm.dbg.value(metadata i32 %n, i64 0, metadata !12, metadata !19), !dbg !20
+  ret void, !dbg !21
+}
+
+declare void @llvm.dbg.value(metadata, i64, metadata, metadata)
+
+!llvm.dbg.cu = !{!0}
+!llvm.module.flags = !{!3, !4, !5}
+!llvm.ident = !{!6}
+
+!0 = distinct !DICompileUnit(language: DW_LANG_C99, file: !1, producer: "clang version 5.0.1", isOptimized: true, runtimeVersion: 0, emissionKind: FullDebug, enums: !2)
+!1 = !DIFile(filename: "vla.c", directory: "/path/to")
+!2 = !{}
+!3 = !{i32 2, !"Dwarf Version", i32 4}
+!4 = !{i32 2, !"Debug Info Version", i32 3}
+!5 = !{i32 1, !"wchar_size", i32 4}
+!6 = !{!"clang version 5.0.1"}
+!7 = distinct !DISubprogram(name: "foo", scope: !1, file: !1, line: 20, type: !8, isLocal: false, isDefinition: true, scopeLine: 20, flags: DIFlagPrototyped, isOptimized: true, unit: !0, retainedNodes: !11)
+!8 = !DISubroutineType(types: !9)
+!9 = !{null, !10}
+!10 = !DIBasicType(name: "int", size: 32, encoding: DW_ATE_signed)
+!11 = !{!12, !13, !15}
+!12 = !DILocalVariable(name: "n", arg: 1, scope: !7, file: !1, line: 20, type: !10)
+!13 = !DILocalVariable(name: "vla_expr", scope: !7, file: !1, line: 21, type: !14)
+!14 = !DIBasicType(name: "long unsigned int", size: 64, encoding: DW_ATE_unsigned)
+!15 = !DILocalVariable(name: "vla", scope: !7, file: !1, line: 21, type: !16)
+!16 = !DICompositeType(tag: DW_TAG_array_type, baseType: !10, align: 32, elements: !17)
+!17 = !{!18, !18}
+!18 = !DISubrange(count: !13)
+!19 = !DIExpression()
+!20 = !DILocation(line: 20, column: 14, scope: !7)
+!21 = !DILocation(line: 22, column: 1, scope: !7)


        


More information about the llvm-commits mailing list