66 lines · plain
1; RUN: llc -mtriple=riscv64 < %s | FileCheck %s --implicit-check-not=DEBUG_VALUE2 3;; Verify that tagged and untagged non-contiguous stores are handled correctly4;; by assignment tracking.5;; * The store to "i" is untagged, and results in the memory location being6;; dropped in favour of the debug value 1010 after the store.7;; * The store to "j" is tagged with a corresponding dbg_assign, which allows8;; us to keep using the memory location.9 10; CHECK-LABEL: foo:11; CHECK-NEXT: .Lfunc_begin0:12; CHECK: # %bb.013; CHECK: addi a1, sp, 4814; CHECK-NEXT: #DEBUG_VALUE: foo:i <- [DW_OP_deref] $x1215; CHECK-NEXT: #DEBUG_VALUE: foo:j <- [DW_OP_deref] $x1216; CHECK: vsse32.v17; CHECK-NEXT: #DEBUG_VALUE: foo:i <- 101018; CHECK-NEXT: vsse32.v19 20 21target datalayout = "e-m:e-p:64:64-i64:64-i128:128-n32:64-S128"22target triple = "riscv64-unknown-linux-gnu"23 24define void @foo() #0 !dbg !5 {25entry:26 %i = alloca i64, align 8, !DIAssignID !627 %j = alloca i64, align 8, !DIAssignID !1228 %sar_height.i = getelementptr i8, ptr %i, i64 2429 store ptr %sar_height.i, ptr null, align 830 %vui.i = getelementptr i8, ptr %i, i64 4431 %0 = load i32, ptr %vui.i, align 432 %sar_width.i = getelementptr i8, ptr %i, i64 2033 %i_sar_width.i = getelementptr i8, ptr %i, i64 4834 %j_sar_width.j = getelementptr i8, ptr %j, i64 4835 #dbg_assign(i32 1010, !7, !DIExpression(), !6, ptr %i_sar_width.i, !DIExpression(), !9)36 #dbg_assign(i32 2121, !17, !DIExpression(), !12, ptr %i_sar_width.i, !DIExpression(), !9)37 %1 = load <2 x i32>, ptr %sar_width.i, align 438 call void @llvm.experimental.vp.strided.store.v2i32.p0.i64(<2 x i32> %1, ptr align 4 %i_sar_width.i, i64 -4, <2 x i1> splat (i1 true), i32 2)39 call void @llvm.experimental.vp.strided.store.v2i32.p0.i64(<2 x i32> %1, ptr align 4 %j_sar_width.j, i64 -4, <2 x i1> splat (i1 true), i32 2), !DIAssignID !1340 #dbg_assign(i32 1010, !7, !DIExpression(), !14, ptr %i_sar_width.i, !DIExpression(), !9)41 #dbg_assign(i32 2121, !17, !DIExpression(), !13, ptr %i_sar_width.i, !DIExpression(), !9)42 ret void43}44 45attributes #0 = { "target-features"="+v" }46 47!llvm.dbg.cu = !{!0}48!llvm.module.flags = !{!3, !4}49 50!0 = distinct !DICompileUnit(language: DW_LANG_C11, file: !1, isOptimized: true, runtimeVersion: 0, emissionKind: FullDebug, producer: "clang version 21.0.0git")51!1 = !DIFile(filename: "test.c", directory: "/")52!2 = !{}53!3 = !{i32 2, !"Debug Info Version", i32 3}54!4 = !{i32 7, !"debug-info-assignment-tracking", i1 true}55!5 = distinct !DISubprogram(name: "foo", linkageName: "foo", scope: !1, file: !1, line: 1, scopeLine: 1, type: !10, spFlags: DISPFlagDefinition | DISPFlagOptimized, unit: !0, retainedNodes: !11)56!6 = distinct !DIAssignID()57!7 = !DILocalVariable(name: "i", scope: !5, file: !1, line: 7, type: !8)58!8 = !DIBasicType(name: "int32_t", size: 32, encoding: DW_ATE_signed)59!9 = !DILocation(line: 5, scope: !5)60!10 = !DISubroutineType(types: !2)61!11 = !{!7, !17}62!12 = distinct !DIAssignID()63!13 = distinct !DIAssignID()64!14 = distinct !DIAssignID()65!17 = !DILocalVariable(name: "j", scope: !5, file: !1, line: 7, type: !8)66