[PATCH] D101594: DAG: Cleanup assertion in EmitFuncArgumentDbgValue
Christudasan Devadasan via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Thu Apr 29 21:26:12 PDT 2021
cdevadas created this revision.
cdevadas added reviewers: jmorse, arsenm.
Herald added subscribers: kerbowa, hiraditya, nhaehnle, jvesely.
cdevadas requested review of this revision.
Herald added subscribers: llvm-commits, wdng.
Herald added a project: LLVM.
Removing an assertion introduced with D68945 <https://reviews.llvm.org/D68945>. The
patch was later reverted with 6531a78ac4b5 <https://reviews.llvm.org/rG6531a78ac4b5b229bce272706593a0bc873877d7>, but failed
to remove this assertion. It causes a problem while
trying to split a 64-bit argument into sub registers.
Repository:
rG LLVM Github Monorepo
https://reviews.llvm.org/D101594
Files:
llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp
llvm/test/CodeGen/AMDGPU/sret-arg-dbg-value.ll
Index: llvm/test/CodeGen/AMDGPU/sret-arg-dbg-value.ll
===================================================================
--- /dev/null
+++ llvm/test/CodeGen/AMDGPU/sret-arg-dbg-value.ll
@@ -0,0 +1,49 @@
+; RUN: llc -mtriple=amdgcn-amd-amdhsa -mcpu=gfx908 < %s | FileCheck %s
+
+%struct.A = type { [100 x i32] }
+
+define hidden void @sret_arg(%struct.A* noalias sret(%struct.A) align 4 %arg) #0 !dbg !9 {
+; CHECK-LABEL: sret_arg:
+; CHECK: ;DEBUG_VALUE: func:a <- [DW_OP_LLVM_fragment 32 32] [$vgpr1+0]
+; CHECK: ;DEBUG_VALUE: func:a <- [DW_OP_LLVM_fragment 0 32] [$vgpr0+0]
+ call void @llvm.dbg.declare(metadata %struct.A* %arg, metadata !20, metadata !DIExpression()), !dbg !21
+ %gep1 = getelementptr inbounds %struct.A, %struct.A* %arg, i32 0, i32 0, !dbg !22
+ %gep2 = getelementptr inbounds [100 x i32], [100 x i32]* %gep1, i64 0, i64 99, !dbg !23
+ store i32 1, i32* %gep2, align 4, !dbg !24
+ ret void, !dbg !25
+}
+
+declare void @llvm.dbg.declare(metadata, metadata, metadata) #0
+
+attributes #0 = { nounwind }
+
+!llvm.dbg.cu = !{!0}
+!llvm.module.flags = !{!3, !4, !5, !6, !7}
+!llvm.ident = !{!8}
+
+!0 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, file: !1, producer: "clang version 13.0.0", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug, enums: !2, splitDebugInlining: false, nameTableKind: None)
+!1 = !DIFile(filename: "example.cpp", directory: "temp")
+!2 = !{}
+!3 = !{i32 7, !"Dwarf Version", i32 4}
+!4 = !{i32 2, !"Debug Info Version", i32 3}
+!5 = !{i32 1, !"wchar_size", i32 4}
+!6 = !{i32 7, !"uwtable", i32 1}
+!7 = !{i32 7, !"frame-pointer", i32 2}
+!8 = !{!"clang version 13.0.0"}
+!9 = distinct !DISubprogram(name: "func", linkageName: "_Z4funcv", scope: !10, file: !10, line: 5, type: !11, scopeLine: 5, flags: DIFlagPrototyped, spFlags: DISPFlagDefinition, unit: !0, retainedNodes: !2)
+!10 = !DIFile(filename: "example.cpp", directory: "temp")
+!11 = !DISubroutineType(types: !12)
+!12 = !{!13}
+!13 = distinct !DICompositeType(tag: DW_TAG_structure_type, name: "A", file: !10, line: 1, size: 3200, flags: DIFlagTypePassByValue, elements: !14, identifier: "_ZTS1A")
+!14 = !{!15}
+!15 = !DIDerivedType(tag: DW_TAG_member, name: "x", scope: !13, file: !10, line: 2, baseType: !16, size: 3200)
+!16 = !DICompositeType(tag: DW_TAG_array_type, baseType: !17, size: 3200, elements: !18)
+!17 = !DIBasicType(name: "int", size: 32, encoding: DW_ATE_signed)
+!18 = !{!19}
+!19 = !DISubrange(count: 100)
+!20 = !DILocalVariable(name: "a", scope: !9, file: !10, line: 6, type: !13)
+!21 = !DILocation(line: 6, column: 7, scope: !9)
+!22 = !DILocation(line: 7, column: 7, scope: !9)
+!23 = !DILocation(line: 7, column: 5, scope: !9)
+!24 = !DILocation(line: 7, column: 13, scope: !9)
+!25 = !DILocation(line: 8, column: 5, scope: !9)
Index: llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp
===================================================================
--- llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp
+++ llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp
@@ -5620,7 +5620,6 @@
DAG.AddDbgValue(SDV, false);
continue;
}
- assert(!IsDbgDeclare && "DbgDeclare operand is not in memory?");
FuncInfo.ArgDbgValues.push_back(
BuildMI(MF, DL, TII->get(TargetOpcode::DBG_VALUE), IsDbgDeclare,
RegAndSize.first, Variable, *FragmentExpr));
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D101594.341765.patch
Type: text/x-patch
Size: 3393 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20210430/8de33582/attachment.bin>
More information about the llvm-commits
mailing list