[llvm] [DebugInfo] Fix crash in declare-to-assign when memcpy writes to scalable-vector alloca (PR #194107)
via llvm-commits
llvm-commits at lists.llvm.org
Sat May 2 08:30:10 PDT 2026
https://github.com/Michael-Chen-NJU updated https://github.com/llvm/llvm-project/pull/194107
>From 06c223dd7b12c6191d667fafa169257f683b620f Mon Sep 17 00:00:00 2001
From: Michael-Chen-NJU <221250121 at smail.nju.edu.cn>
Date: Fri, 24 Apr 2026 22:34:19 +0800
Subject: [PATCH 1/2] [DebugInfo] Fix crash in declare-to-assign when memcpy
writes to scalable-vector alloca
---
llvm/lib/IR/DebugInfo.cpp | 5 +-
.../scalable-vector-memcpy.ll | 142 ++++++++++++++++++
2 files changed, 146 insertions(+), 1 deletion(-)
create mode 100644 llvm/test/DebugInfo/Generic/assignment-tracking/declare-to-assign/scalable-vector-memcpy.ll
diff --git a/llvm/lib/IR/DebugInfo.cpp b/llvm/lib/IR/DebugInfo.cpp
index d27c3a9a1548a..9ffc7c96a54e6 100644
--- a/llvm/lib/IR/DebugInfo.cpp
+++ b/llvm/lib/IR/DebugInfo.cpp
@@ -2120,8 +2120,11 @@ getAssignmentInfoImpl(const DataLayout &DL, const Value *StoreDest,
// Check for overflow.
if (OffsetInBytes == UINT64_MAX)
return std::nullopt;
- if (const auto *Alloca = dyn_cast<AllocaInst>(Base))
+ if (const auto *Alloca = dyn_cast<AllocaInst>(Base)) {
+ if (DL.getTypeSizeInBits(Alloca->getAllocatedType()).isScalable())
+ return std::nullopt;
return AssignmentInfo(DL, Alloca, OffsetInBytes * 8, SizeInBits);
+ }
return std::nullopt;
}
diff --git a/llvm/test/DebugInfo/Generic/assignment-tracking/declare-to-assign/scalable-vector-memcpy.ll b/llvm/test/DebugInfo/Generic/assignment-tracking/declare-to-assign/scalable-vector-memcpy.ll
new file mode 100644
index 0000000000000..fbbb27914e1a8
--- /dev/null
+++ b/llvm/test/DebugInfo/Generic/assignment-tracking/declare-to-assign/scalable-vector-memcpy.ll
@@ -0,0 +1,142 @@
+; NOTE: Assertions have been autogenerated by utils/update_test_checks.py UTC_ARGS: --version 6
+; RUN: opt -passes=declare-to-assign %s -S | FileCheck %s
+
+;; Check that declare-to-assign does not crash when a fixed-size memcpy writes
+;; into a scalable-vector alloca. getAssignmentInfoImpl must bail out when the
+;; destination alloca's type is scalable, not only when the store size itself is
+;; scalable. The dbg.declare for the scalable alloca should be preserved as-is.
+;;
+;; Derived from: https://github.com/llvm/llvm-project/issues/192728
+;; #include <string.h>
+;; #include <riscv_vector.h>
+;; vint32m1_t get_i32x4(int* v) {
+;; vint32m1_t r;
+;; memcpy(&r, v, 16);
+;; return r;
+;; }
+;; Compiled with: clang -target riscv64-unknown-linux-gnu -march=rv64gcv -O1 -g
+
+
+target datalayout = "e-m:e-p:64:64-i64:64-i128:128-n32:64-S128"
+target triple = "riscv64-unknown-linux-gnu"
+
+define dso_local <vscale x 2 x i32> @get_i32x4(ptr noundef %0) #0 !dbg !16 {
+; CHECK-LABEL: define dso_local <vscale x 2 x i32> @get_i32x4(
+; CHECK-SAME: ptr noundef [[TMP0:%.*]]) #[[ATTR0:[0-9]+]] !dbg [[DBG17:![0-9]+]] {
+; CHECK-NEXT: [[TMP2:%.*]] = alloca ptr, align 8, !DIAssignID [[DIASSIGNID30:![0-9]+]]
+; CHECK-NEXT: #dbg_assign(i1 poison, [[META28:![0-9]+]], !DIExpression(), [[DIASSIGNID30]], ptr [[TMP2]], !DIExpression(), [[META31:![0-9]+]])
+; CHECK-NEXT: [[TMP3:%.*]] = alloca <vscale x 2 x i32>, align 4
+; CHECK-NEXT: store ptr [[TMP0]], ptr [[TMP2]], align 8, !tbaa [[INTPTR_TBAA32:![0-9]+]], !DIAssignID [[DIASSIGNID35:![0-9]+]]
+; CHECK-NEXT: #dbg_assign(ptr [[TMP0]], [[META28]], !DIExpression(), [[DIASSIGNID35]], ptr [[TMP2]], !DIExpression(), [[META31]])
+; CHECK-NEXT: call void @llvm.lifetime.start.p0(ptr [[TMP3]]) #[[ATTR3:[0-9]+]], !dbg [[DBG36:![0-9]+]]
+; CHECK-NEXT: #dbg_declare(ptr [[TMP3]], [[META29:![0-9]+]], !DIExpression(), [[META37:![0-9]+]])
+; CHECK-NEXT: [[TMP4:%.*]] = load ptr, ptr [[TMP2]], align 8, !dbg [[DBG38:![0-9]+]], !tbaa [[INTPTR_TBAA32]]
+; CHECK-NEXT: call void @llvm.memcpy.p0.p0.i64(ptr align 4 [[TMP3]], ptr align 4 [[TMP4]], i64 16, i1 false), !dbg [[DBG39:![0-9]+]]
+; CHECK-NEXT: [[TMP5:%.*]] = load <vscale x 2 x i32>, ptr [[TMP3]], align 4, !dbg [[DBG40:![0-9]+]], !tbaa [[__RVV_INT32M1_T_TBAA41:![0-9]+]]
+; CHECK-NEXT: call void @llvm.lifetime.end.p0(ptr [[TMP3]]) #[[ATTR3]], !dbg [[DBG43:![0-9]+]]
+; CHECK-NEXT: ret <vscale x 2 x i32> [[TMP5]], !dbg [[DBG44:![0-9]+]]
+;
+ %2 = alloca ptr, align 8
+ %3 = alloca <vscale x 2 x i32>, align 4
+ store ptr %0, ptr %2, align 8, !tbaa !31
+ #dbg_declare(ptr %2, !29, !DIExpression(), !34)
+ call void @llvm.lifetime.start.p0(ptr %3) #3, !dbg !35
+ #dbg_declare(ptr %3, !30, !DIExpression(), !36)
+ %4 = load ptr, ptr %2, align 8, !dbg !37, !tbaa !31
+ call void @llvm.memcpy.p0.p0.i64(ptr align 4 %3, ptr align 4 %4, i64 16, i1 false), !dbg !38
+ %5 = load <vscale x 2 x i32>, ptr %3, align 4, !dbg !39, !tbaa !40
+ call void @llvm.lifetime.end.p0(ptr %3) #3, !dbg !42
+ ret <vscale x 2 x i32> %5, !dbg !43
+}
+
+declare void @llvm.lifetime.start.p0(ptr captures(none)) #1
+declare void @llvm.memcpy.p0.p0.i64(ptr noalias writeonly captures(none), ptr noalias readonly captures(none), i64, i1 immarg) #2
+declare void @llvm.lifetime.end.p0(ptr captures(none)) #1
+
+attributes #0 = { nounwind uwtable vscale_range(2,1024) "target-cpu"="generic-rv64" "target-features"="+64bit,+v" }
+attributes #1 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
+attributes #2 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) }
+attributes #3 = { nounwind }
+
+!llvm.dbg.cu = !{!0}
+!llvm.module.flags = !{!2, !3, !4, !5, !7, !8, !9, !10}
+!llvm.ident = !{!11}
+!llvm.errno.tbaa = !{!12}
+
+!0 = distinct !DICompileUnit(language: DW_LANG_C11, file: !1, producer: "clang", isOptimized: true, runtimeVersion: 0, emissionKind: FullDebug, splitDebugInlining: false, nameTableKind: None)
+!1 = !DIFile(filename: "a.c", directory: "/")
+!2 = !{i32 7, !"Dwarf Version", i32 5}
+!3 = !{i32 2, !"Debug Info Version", i32 3}
+!4 = !{i32 1, !"target-abi", !"lp64d"}
+!5 = !{i32 6, !"riscv-isa", !6}
+!6 = !{!"rv64i2p1_m2p0_a2p1_f2p2_d2p2_c2p0_v1p0_zicsr2p0_zifencei2p0_zmmul1p0_zaamo1p0_zalrsc1p0_zca1p0_zcd1p0_zve32f1p0_zve32x1p0_zve64d1p0_zve64f1p0_zve64x1p0_zvl128b1p0_zvl32b1p0_zvl64b1p0"}
+!7 = !{i32 8, !"PIC Level", i32 2}
+!8 = !{i32 7, !"PIE Level", i32 2}
+!9 = !{i32 7, !"uwtable", i32 2}
+!10 = !{i32 8, !"SmallDataLimit", i32 0}
+!11 = !{!"clang"}
+!12 = !{!13, !13, i64 0}
+!13 = !{!"int", !14, i64 0}
+!14 = !{!"omnipotent char", !15, i64 0}
+!15 = !{!"Simple C/C++ TBAA"}
+!16 = distinct !DISubprogram(name: "get_i32x4", scope: !17, file: !17, line: 4, type: !18, scopeLine: 4, flags: DIFlagPrototyped | DIFlagAllCallsDescribed, spFlags: DISPFlagDefinition | DISPFlagOptimized, unit: !0, retainedNodes: !28, keyInstructions: true)
+!17 = !DIFile(filename: "a.c", directory: "/")
+!18 = !DISubroutineType(types: !19)
+!19 = !{!20, !27}
+!20 = !DIDerivedType(tag: DW_TAG_typedef, name: "vint32m1_t", file: !17, baseType: !22)
+!22 = !DIDerivedType(tag: DW_TAG_typedef, name: "__rvv_int32m1_t", file: !17, baseType: !23)
+!23 = !DICompositeType(tag: DW_TAG_array_type, baseType: !24, flags: DIFlagVector, elements: !25)
+!24 = !DIBasicType(name: "int", size: 32, encoding: DW_ATE_signed)
+!25 = !{!26}
+!26 = !DISubrange(lowerBound: 0, upperBound: !DIExpression(DW_OP_bregx, 7202, 0, DW_OP_constu, 4, DW_OP_div, DW_OP_constu, 1, DW_OP_mul, DW_OP_constu, 1, DW_OP_minus))
+!27 = !DIDerivedType(tag: DW_TAG_pointer_type, baseType: !24, size: 64)
+!28 = !{!29, !30}
+!29 = !DILocalVariable(name: "v", arg: 1, scope: !16, file: !17, line: 4, type: !27)
+!30 = !DILocalVariable(name: "r", scope: !16, file: !17, line: 5, type: !20)
+!31 = !{!32, !32, i64 0}
+!32 = !{!"p1 int", !33, i64 0}
+!33 = !{!"any pointer", !14, i64 0}
+!34 = !DILocation(line: 4, column: 27, scope: !16)
+!35 = !DILocation(line: 5, column: 3, scope: !16)
+!36 = !DILocation(line: 5, column: 14, scope: !16)
+!37 = !DILocation(line: 6, column: 14, scope: !16)
+!38 = !DILocation(line: 6, column: 3, scope: !16, atomGroup: 1, atomRank: 1)
+!39 = !DILocation(line: 7, column: 10, scope: !16, atomGroup: 3, atomRank: 2)
+!40 = !{!41, !41, i64 0}
+!41 = !{!"__rvv_int32m1_t", !14, i64 0}
+!42 = !DILocation(line: 8, column: 1, scope: !16)
+!43 = !DILocation(line: 7, column: 3, scope: !16, atomGroup: 3, atomRank: 1)
+;.
+; CHECK: [[META0:![0-9]+]] = distinct !DICompileUnit(language: DW_LANG_C11, file: [[META1:![0-9]+]], producer: "clang", isOptimized: true, runtimeVersion: 0, emissionKind: FullDebug, splitDebugInlining: false, nameTableKind: None)
+; CHECK: [[META1]] = !DIFile(filename: "{{.*}}a.c", directory: {{.*}})
+; CHECK: [[META15:![0-9]+]] = !{!"omnipotent char", [[META16:![0-9]+]], i64 0}
+; CHECK: [[META16]] = !{!"Simple C/C++ TBAA"}
+; CHECK: [[DBG17]] = distinct !DISubprogram(name: "get_i32x4", scope: [[META1]], file: [[META1]], line: 4, type: [[META18:![0-9]+]], scopeLine: 4, flags: DIFlagPrototyped | DIFlagAllCallsDescribed, spFlags: DISPFlagDefinition | DISPFlagOptimized, unit: [[META0]], retainedNodes: [[META27:![0-9]+]], keyInstructions: true)
+; CHECK: [[META18]] = !DISubroutineType(types: [[META19:![0-9]+]])
+; CHECK: [[META19]] = !{[[META20:![0-9]+]], [[META26:![0-9]+]]}
+; CHECK: [[META20]] = !DIDerivedType(tag: DW_TAG_typedef, name: "vint32m1_t", file: [[META1]], baseType: [[META21:![0-9]+]])
+; CHECK: [[META21]] = !DIDerivedType(tag: DW_TAG_typedef, name: "__rvv_int32m1_t", file: [[META1]], baseType: [[META22:![0-9]+]])
+; CHECK: [[META22]] = !DICompositeType(tag: DW_TAG_array_type, baseType: [[META23:![0-9]+]], flags: DIFlagVector, elements: [[META24:![0-9]+]])
+; CHECK: [[META23]] = !DIBasicType(name: "int", size: 32, encoding: DW_ATE_signed)
+; CHECK: [[META24]] = !{[[META25:![0-9]+]]}
+; CHECK: [[META25]] = !DISubrange(lowerBound: 0, upperBound: !DIExpression(DW_OP_bregx, 7202, 0, DW_OP_constu, 4, DW_OP_div, DW_OP_constu, 1, DW_OP_mul, DW_OP_constu, 1, DW_OP_minus))
+; CHECK: [[META26]] = !DIDerivedType(tag: DW_TAG_pointer_type, baseType: [[META23]], size: 64)
+; CHECK: [[META27]] = !{[[META28]], [[META29]]}
+; CHECK: [[META28]] = !DILocalVariable(name: "v", arg: 1, scope: [[DBG17]], file: [[META1]], line: 4, type: [[META26]])
+; CHECK: [[META29]] = !DILocalVariable(name: "r", scope: [[DBG17]], file: [[META1]], line: 5, type: [[META20]])
+; CHECK: [[DIASSIGNID30]] = distinct !DIAssignID()
+; CHECK: [[META31]] = !DILocation(line: 0, scope: [[DBG17]])
+; CHECK: [[INTPTR_TBAA32]] = !{[[META33:![0-9]+]], [[META33]], i64 0}
+; CHECK: [[META33]] = !{!"p1 int", [[META34:![0-9]+]], i64 0}
+; CHECK: [[META34]] = !{!"any pointer", [[META15]], i64 0}
+; CHECK: [[DIASSIGNID35]] = distinct !DIAssignID()
+; CHECK: [[DBG36]] = !DILocation(line: 5, column: 3, scope: [[DBG17]])
+; CHECK: [[META37]] = !DILocation(line: 5, column: 14, scope: [[DBG17]])
+; CHECK: [[DBG38]] = !DILocation(line: 6, column: 14, scope: [[DBG17]])
+; CHECK: [[DBG39]] = !DILocation(line: 6, column: 3, scope: [[DBG17]], atomGroup: 1, atomRank: 1)
+; CHECK: [[DBG40]] = !DILocation(line: 7, column: 10, scope: [[DBG17]], atomGroup: 3, atomRank: 2)
+; CHECK: [[__RVV_INT32M1_T_TBAA41]] = !{[[META42:![0-9]+]], [[META42]], i64 0}
+; CHECK: [[META42]] = !{!"__rvv_int32m1_t", [[META15]], i64 0}
+; CHECK: [[DBG43]] = !DILocation(line: 8, column: 1, scope: [[DBG17]])
+; CHECK: [[DBG44]] = !DILocation(line: 7, column: 3, scope: [[DBG17]], atomGroup: 3, atomRank: 1)
+;.
>From c4ca629d30f6f15d6011e4ecfa2c9a0e031c61f9 Mon Sep 17 00:00:00 2001
From: Michael-Chen-NJU <221250121 at smail.nju.edu.cn>
Date: Fri, 1 May 2026 10:21:02 +0800
Subject: [PATCH 2/2] [DebugInfo] Address review comments: simplify
if-statement and fix test
Simplify the if-statement in getAssignmentInfoImpl per review nit.
Fix the test: restore the #dbg_declare for the non-scalable alloca %2
(needed to trigger the crash path on unpatched LLVM), rename the scalable
alloca to %r (avoids fragile auto-numbered value references in CHECKs),
and update the CHECK sequence to use the three-line pattern:
; CHECK: = alloca <vscale x 2 x i32>, align 4
; CHECK-NOT: DIAssignID
; CHECK-SAME: {{$}}
which verifies no !DIAssignID annotation appears on the same line as the
alloca, without relying on the absence of any subsequent alloca.
Also add CHECK-NOT: #dbg_assign to confirm the dbg.declare is preserved.
---
llvm/lib/IR/DebugInfo.cpp | 8 +-
.../scalable-vector-memcpy.ll | 91 ++++---------------
2 files changed, 22 insertions(+), 77 deletions(-)
diff --git a/llvm/lib/IR/DebugInfo.cpp b/llvm/lib/IR/DebugInfo.cpp
index 9ffc7c96a54e6..8f7c676c66cce 100644
--- a/llvm/lib/IR/DebugInfo.cpp
+++ b/llvm/lib/IR/DebugInfo.cpp
@@ -2120,11 +2120,9 @@ getAssignmentInfoImpl(const DataLayout &DL, const Value *StoreDest,
// Check for overflow.
if (OffsetInBytes == UINT64_MAX)
return std::nullopt;
- if (const auto *Alloca = dyn_cast<AllocaInst>(Base)) {
- if (DL.getTypeSizeInBits(Alloca->getAllocatedType()).isScalable())
- return std::nullopt;
- return AssignmentInfo(DL, Alloca, OffsetInBytes * 8, SizeInBits);
- }
+ if (const auto *Alloca = dyn_cast<AllocaInst>(Base))
+ if (!DL.getTypeSizeInBits(Alloca->getAllocatedType()).isScalable())
+ return AssignmentInfo(DL, Alloca, OffsetInBytes * 8, SizeInBits);
return std::nullopt;
}
diff --git a/llvm/test/DebugInfo/Generic/assignment-tracking/declare-to-assign/scalable-vector-memcpy.ll b/llvm/test/DebugInfo/Generic/assignment-tracking/declare-to-assign/scalable-vector-memcpy.ll
index fbbb27914e1a8..6f1ff33b6bedc 100644
--- a/llvm/test/DebugInfo/Generic/assignment-tracking/declare-to-assign/scalable-vector-memcpy.ll
+++ b/llvm/test/DebugInfo/Generic/assignment-tracking/declare-to-assign/scalable-vector-memcpy.ll
@@ -1,4 +1,3 @@
-; NOTE: Assertions have been autogenerated by utils/update_test_checks.py UTC_ARGS: --version 6
; RUN: opt -passes=declare-to-assign %s -S | FileCheck %s
;; Check that declare-to-assign does not crash when a fixed-size memcpy writes
@@ -16,52 +15,37 @@
;; }
;; Compiled with: clang -target riscv64-unknown-linux-gnu -march=rv64gcv -O1 -g
+;; The scalable-vector alloca must not be annotated with DIAssignID.
+; CHECK: = alloca <vscale x 2 x i32>, align 4
+; CHECK-NOT: DIAssignID
+; CHECK-SAME: {{$}}
+;; Its dbg.declare must be preserved (not converted to dbg.assign).
+; CHECK: #dbg_declare(ptr %r,
+; CHECK-NOT: #dbg_assign(ptr %r,
target datalayout = "e-m:e-p:64:64-i64:64-i128:128-n32:64-S128"
target triple = "riscv64-unknown-linux-gnu"
-define dso_local <vscale x 2 x i32> @get_i32x4(ptr noundef %0) #0 !dbg !16 {
-; CHECK-LABEL: define dso_local <vscale x 2 x i32> @get_i32x4(
-; CHECK-SAME: ptr noundef [[TMP0:%.*]]) #[[ATTR0:[0-9]+]] !dbg [[DBG17:![0-9]+]] {
-; CHECK-NEXT: [[TMP2:%.*]] = alloca ptr, align 8, !DIAssignID [[DIASSIGNID30:![0-9]+]]
-; CHECK-NEXT: #dbg_assign(i1 poison, [[META28:![0-9]+]], !DIExpression(), [[DIASSIGNID30]], ptr [[TMP2]], !DIExpression(), [[META31:![0-9]+]])
-; CHECK-NEXT: [[TMP3:%.*]] = alloca <vscale x 2 x i32>, align 4
-; CHECK-NEXT: store ptr [[TMP0]], ptr [[TMP2]], align 8, !tbaa [[INTPTR_TBAA32:![0-9]+]], !DIAssignID [[DIASSIGNID35:![0-9]+]]
-; CHECK-NEXT: #dbg_assign(ptr [[TMP0]], [[META28]], !DIExpression(), [[DIASSIGNID35]], ptr [[TMP2]], !DIExpression(), [[META31]])
-; CHECK-NEXT: call void @llvm.lifetime.start.p0(ptr [[TMP3]]) #[[ATTR3:[0-9]+]], !dbg [[DBG36:![0-9]+]]
-; CHECK-NEXT: #dbg_declare(ptr [[TMP3]], [[META29:![0-9]+]], !DIExpression(), [[META37:![0-9]+]])
-; CHECK-NEXT: [[TMP4:%.*]] = load ptr, ptr [[TMP2]], align 8, !dbg [[DBG38:![0-9]+]], !tbaa [[INTPTR_TBAA32]]
-; CHECK-NEXT: call void @llvm.memcpy.p0.p0.i64(ptr align 4 [[TMP3]], ptr align 4 [[TMP4]], i64 16, i1 false), !dbg [[DBG39:![0-9]+]]
-; CHECK-NEXT: [[TMP5:%.*]] = load <vscale x 2 x i32>, ptr [[TMP3]], align 4, !dbg [[DBG40:![0-9]+]], !tbaa [[__RVV_INT32M1_T_TBAA41:![0-9]+]]
-; CHECK-NEXT: call void @llvm.lifetime.end.p0(ptr [[TMP3]]) #[[ATTR3]], !dbg [[DBG43:![0-9]+]]
-; CHECK-NEXT: ret <vscale x 2 x i32> [[TMP5]], !dbg [[DBG44:![0-9]+]]
-;
+define dso_local <vscale x 2 x i32> @get_i32x4(ptr noundef %0) !dbg !16 {
%2 = alloca ptr, align 8
- %3 = alloca <vscale x 2 x i32>, align 4
+ %r = alloca <vscale x 2 x i32>, align 4
store ptr %0, ptr %2, align 8, !tbaa !31
#dbg_declare(ptr %2, !29, !DIExpression(), !34)
- call void @llvm.lifetime.start.p0(ptr %3) #3, !dbg !35
- #dbg_declare(ptr %3, !30, !DIExpression(), !36)
- %4 = load ptr, ptr %2, align 8, !dbg !37, !tbaa !31
- call void @llvm.memcpy.p0.p0.i64(ptr align 4 %3, ptr align 4 %4, i64 16, i1 false), !dbg !38
- %5 = load <vscale x 2 x i32>, ptr %3, align 4, !dbg !39, !tbaa !40
- call void @llvm.lifetime.end.p0(ptr %3) #3, !dbg !42
- ret <vscale x 2 x i32> %5, !dbg !43
+ call void @llvm.lifetime.start.p0(ptr %r), !dbg !35
+ #dbg_declare(ptr %r, !30, !DIExpression(), !36)
+ %3 = load ptr, ptr %2, align 8, !dbg !37, !tbaa !31
+ call void @llvm.memcpy.p0.p0.i64(ptr align 4 %r, ptr align 4 %3, i64 16, i1 false), !dbg !38
+ %4 = load <vscale x 2 x i32>, ptr %r, align 4, !dbg !39, !tbaa !40
+ call void @llvm.lifetime.end.p0(ptr %r), !dbg !42
+ ret <vscale x 2 x i32> %4, !dbg !43
}
-declare void @llvm.lifetime.start.p0(ptr captures(none)) #1
-declare void @llvm.memcpy.p0.p0.i64(ptr noalias writeonly captures(none), ptr noalias readonly captures(none), i64, i1 immarg) #2
-declare void @llvm.lifetime.end.p0(ptr captures(none)) #1
-
-attributes #0 = { nounwind uwtable vscale_range(2,1024) "target-cpu"="generic-rv64" "target-features"="+64bit,+v" }
-attributes #1 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
-attributes #2 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) }
-attributes #3 = { nounwind }
+declare void @llvm.lifetime.start.p0(ptr captures(none))
+declare void @llvm.memcpy.p0.p0.i64(ptr noalias writeonly captures(none), ptr noalias readonly captures(none), i64, i1 immarg)
+declare void @llvm.lifetime.end.p0(ptr captures(none))
!llvm.dbg.cu = !{!0}
!llvm.module.flags = !{!2, !3, !4, !5, !7, !8, !9, !10}
-!llvm.ident = !{!11}
-!llvm.errno.tbaa = !{!12}
!0 = distinct !DICompileUnit(language: DW_LANG_C11, file: !1, producer: "clang", isOptimized: true, runtimeVersion: 0, emissionKind: FullDebug, splitDebugInlining: false, nameTableKind: None)
!1 = !DIFile(filename: "a.c", directory: "/")
@@ -74,9 +58,6 @@ attributes #3 = { nounwind }
!8 = !{i32 7, !"PIE Level", i32 2}
!9 = !{i32 7, !"uwtable", i32 2}
!10 = !{i32 8, !"SmallDataLimit", i32 0}
-!11 = !{!"clang"}
-!12 = !{!13, !13, i64 0}
-!13 = !{!"int", !14, i64 0}
!14 = !{!"omnipotent char", !15, i64 0}
!15 = !{!"Simple C/C++ TBAA"}
!16 = distinct !DISubprogram(name: "get_i32x4", scope: !17, file: !17, line: 4, type: !18, scopeLine: 4, flags: DIFlagPrototyped | DIFlagAllCallsDescribed, spFlags: DISPFlagDefinition | DISPFlagOptimized, unit: !0, retainedNodes: !28, keyInstructions: true)
@@ -106,37 +87,3 @@ attributes #3 = { nounwind }
!41 = !{!"__rvv_int32m1_t", !14, i64 0}
!42 = !DILocation(line: 8, column: 1, scope: !16)
!43 = !DILocation(line: 7, column: 3, scope: !16, atomGroup: 3, atomRank: 1)
-;.
-; CHECK: [[META0:![0-9]+]] = distinct !DICompileUnit(language: DW_LANG_C11, file: [[META1:![0-9]+]], producer: "clang", isOptimized: true, runtimeVersion: 0, emissionKind: FullDebug, splitDebugInlining: false, nameTableKind: None)
-; CHECK: [[META1]] = !DIFile(filename: "{{.*}}a.c", directory: {{.*}})
-; CHECK: [[META15:![0-9]+]] = !{!"omnipotent char", [[META16:![0-9]+]], i64 0}
-; CHECK: [[META16]] = !{!"Simple C/C++ TBAA"}
-; CHECK: [[DBG17]] = distinct !DISubprogram(name: "get_i32x4", scope: [[META1]], file: [[META1]], line: 4, type: [[META18:![0-9]+]], scopeLine: 4, flags: DIFlagPrototyped | DIFlagAllCallsDescribed, spFlags: DISPFlagDefinition | DISPFlagOptimized, unit: [[META0]], retainedNodes: [[META27:![0-9]+]], keyInstructions: true)
-; CHECK: [[META18]] = !DISubroutineType(types: [[META19:![0-9]+]])
-; CHECK: [[META19]] = !{[[META20:![0-9]+]], [[META26:![0-9]+]]}
-; CHECK: [[META20]] = !DIDerivedType(tag: DW_TAG_typedef, name: "vint32m1_t", file: [[META1]], baseType: [[META21:![0-9]+]])
-; CHECK: [[META21]] = !DIDerivedType(tag: DW_TAG_typedef, name: "__rvv_int32m1_t", file: [[META1]], baseType: [[META22:![0-9]+]])
-; CHECK: [[META22]] = !DICompositeType(tag: DW_TAG_array_type, baseType: [[META23:![0-9]+]], flags: DIFlagVector, elements: [[META24:![0-9]+]])
-; CHECK: [[META23]] = !DIBasicType(name: "int", size: 32, encoding: DW_ATE_signed)
-; CHECK: [[META24]] = !{[[META25:![0-9]+]]}
-; CHECK: [[META25]] = !DISubrange(lowerBound: 0, upperBound: !DIExpression(DW_OP_bregx, 7202, 0, DW_OP_constu, 4, DW_OP_div, DW_OP_constu, 1, DW_OP_mul, DW_OP_constu, 1, DW_OP_minus))
-; CHECK: [[META26]] = !DIDerivedType(tag: DW_TAG_pointer_type, baseType: [[META23]], size: 64)
-; CHECK: [[META27]] = !{[[META28]], [[META29]]}
-; CHECK: [[META28]] = !DILocalVariable(name: "v", arg: 1, scope: [[DBG17]], file: [[META1]], line: 4, type: [[META26]])
-; CHECK: [[META29]] = !DILocalVariable(name: "r", scope: [[DBG17]], file: [[META1]], line: 5, type: [[META20]])
-; CHECK: [[DIASSIGNID30]] = distinct !DIAssignID()
-; CHECK: [[META31]] = !DILocation(line: 0, scope: [[DBG17]])
-; CHECK: [[INTPTR_TBAA32]] = !{[[META33:![0-9]+]], [[META33]], i64 0}
-; CHECK: [[META33]] = !{!"p1 int", [[META34:![0-9]+]], i64 0}
-; CHECK: [[META34]] = !{!"any pointer", [[META15]], i64 0}
-; CHECK: [[DIASSIGNID35]] = distinct !DIAssignID()
-; CHECK: [[DBG36]] = !DILocation(line: 5, column: 3, scope: [[DBG17]])
-; CHECK: [[META37]] = !DILocation(line: 5, column: 14, scope: [[DBG17]])
-; CHECK: [[DBG38]] = !DILocation(line: 6, column: 14, scope: [[DBG17]])
-; CHECK: [[DBG39]] = !DILocation(line: 6, column: 3, scope: [[DBG17]], atomGroup: 1, atomRank: 1)
-; CHECK: [[DBG40]] = !DILocation(line: 7, column: 10, scope: [[DBG17]], atomGroup: 3, atomRank: 2)
-; CHECK: [[__RVV_INT32M1_T_TBAA41]] = !{[[META42:![0-9]+]], [[META42]], i64 0}
-; CHECK: [[META42]] = !{!"__rvv_int32m1_t", [[META15]], i64 0}
-; CHECK: [[DBG43]] = !DILocation(line: 8, column: 1, scope: [[DBG17]])
-; CHECK: [[DBG44]] = !DILocation(line: 7, column: 3, scope: [[DBG17]], atomGroup: 3, atomRank: 1)
-;.
More information about the llvm-commits
mailing list