Hello,
I am trying to find out the reason, Why debug-locations for function parameters have been removed in clang-trunk.
In clang-15 and clang-16 the debug-locations are present.
Attaching the MachineFunction information for clang-16 and clang-trunk…
Clang-16
bb.0.entry:
successors: %bb.1(0x80000000); %bb.1(100.00%)
liveins: $x10, $x11, $x12, $x13, $x14, $x1
DBG_VALUE $x11, 0, !"linked_list1", !DIExpression(), debug-location !1449; jira.c:827:30 line no:827 indirect
DBG_VALUE $x12, 0, !"linked_list2", !DIExpression(), debug-location !1451; jira.c:828:30 line no:828 indirect
DBG_VALUE $x13, 0, !"linked_list3", !DIExpression(), debug-location !1453; jira.c:829:30 line no:829 indirect
DBG_VALUE $x14, 0, !"linked_list4", !DIExpression(), debug-location !1455; jira.c:830:30 line no:830 indirect
$x2 = frame-setup ADDI $x2, -64
frame-setup CFI_INSTRUCTION def_cfa_offset 64
***SD killed $x1, $x2, 56, debug-location !1455 :: (store (s64) into %stack.7); jira.c:830:30***
*** SD killed $x8, $x2, 48, debug-location !1455 :: (store (s64) into %stack.8); jira.c:830:30***
frame-setup CFI_INSTRUCTION offset $x1, -8
frame-setup CFI_INSTRUCTION offset $x8, -16
$x8 = frame-setup ADDI $x2, 64
frame-setup CFI_INSTRUCTION def_cfa $x8, 0
SD killed $x14, $x8, -64, debug-location !1455 :: (store (s64) into %stack.6); jira.c:830:30
DBG_VALUE $x8, 0, !"linked_list4", !DIExpression(DW_OP_constu, 64, DW_OP_minus, DW_OP_deref), debug-location !1455; jira.c:830:30 line no:830 indirect
DBG_VALUE $x8, 0, !"linked_list4", !DIExpression(DW_OP_constu, 64, DW_OP_minus, DW_OP_deref), debug-location !1455; jira.c:830:30 line no:830 indirect
DBG_VALUE renamable $x14, 0, !"linked_list4", !DIExpression(), debug-location !1455; jira.c:830:30 line no:830 indirect
SD killed $x13, $x8, -56, debug-location !1453 :: (store (s64) into %stack.5); jira.c:829:30
DBG_VALUE $x8, 0, !"linked_list3", !DIExpression(DW_OP_constu, 56, DW_OP_minus, DW_OP_deref), debug-location !1453; jira.c:829:30 line no:829 indirect
DBG_VALUE $x8, 0, !"linked_list3", !DIExpression(DW_OP_constu, 56, DW_OP_minus, DW_OP_deref), debug-location !1453; jira.c:829:30 line no:829 indirect
DBG_VALUE renamable $x13, 0, !"linked_list3", !DIExpression(), debug-location !1453; jira.c:829:30 line no:829 indirect
SD killed $x12, $x8, -48, debug-location !1451 :: (store (s64) into %stack.4); jira.c:828:30
DBG_VALUE $x8, 0, !"linked_list2", !DIExpression(DW_OP_constu, 48, DW_OP_minus, DW_OP_deref), debug-location !1451; jira.c:828:30 line no:828 indirect
DBG_VALUE $x8, 0, !"linked_list2", !DIExpression(DW_OP_constu, 48, DW_OP_minus, DW_OP_deref), debug-location !1451; jira.c:828:30 line no:828 indirect
DBG_VALUE renamable $x12, 0, !"linked_list2", !DIExpression(), debug-location !1451; jira.c:828:30 line no:828 indirect
SD killed $x11, $x8, -40, debug-location !1449 :: (store (s64) into %stack.3); jira.c:827:30
DBG_VALUE $x8, 0, !"linked_list1", !DIExpression(DW_OP_constu, 40, DW_OP_minus, DW_OP_deref), debug-location !1449; jira.c:827:30 line no:827 indirect
DBG_VALUE $x8, 0, !"linked_list1", !DIExpression(DW_OP_constu, 40, DW_OP_minus, DW_OP_deref), debug-location !1449; jira.c:827:30 line no:827 indirect
DBG_VALUE renamable $x11, 0, !"linked_list1", !DIExpression(), debug-location !1449; jira.c:827:30 line no:827 indirect
dead renamable $x11 = KILL renamable $x10
SW killed renamable $x10, $x8, -20 :: (store (s32) into %ir.seed.addr)
renamable $x10 = LUI target-flags(riscv-hi) @.str.64, debug-location !1460; jira.c:835:6
renamable $x10 = ADDI killed renamable $x10, target-flags(riscv-lo) @.str.64, debug-location !1460; jira.c:835:6
Clang-Trunk
bb.0.entry:
successors: %bb.1(0x80000000); %bb.1(100.00%)
liveins: $x10, $x11, $x12, $x13, $x14, $x1
$x2 = frame-setup ADDI $x2, -96
frame-setup CFI_INSTRUCTION def_cfa_offset 96
SD killed $x1, $x2, 88 :: (store (s64) into %stack.11)
SD killed $x8, $x2, 80 :: (store (s64) into %stack.12)
frame-setup CFI_INSTRUCTION offset $x1, -8
frame-setup CFI_INSTRUCTION offset $x8, -16
$x8 = frame-setup ADDI $x2, 96
frame-setup CFI_INSTRUCTION def_cfa $x8, 0
SD $x14, $x8, -96 :: (store (s64) into %stack.10)
SD $x13, $x8, -88 :: (store (s64) into %stack.9)
SD $x12, $x8, -80 :: (store (s64) into %stack.8)
SD $x11, $x8, -72 :: (store (s64) into %stack.7)
dead renamable $x15 = KILL renamable $x10
SW killed renamable $x10, $x8, -20 :: (store (s32) into %ir.seed.addr)
SD renamable $x11, $x8, -32 :: (store (s64) into %ir.linked_list1.indirect_addr)
SD renamable $x12, $x8, -40 :: (store (s64) into %ir.linked_list2.indirect_addr)
SD renamable $x13, $x8, -48 :: (store (s64) into %ir.linked_list3.indirect_addr)
SD renamable $x14, $x8, -56 :: (store (s64) into %ir.linked_list4.indirect_addr)
renamable $x10 = LUI target-flags(riscv-hi) @.str.64, debug-location !1460; jira.c:835:6
renamable $x10 = ADDI killed renamable $x10, target-flags(riscv-lo) @.str.64, debug-location !1460; jira.c:835:6
PseudoCALL target-flags(riscv-call) @printf, <regmask $vlenb $x0 $x1 $x3 $x4 $x8 $x9 $x18 $x19 $x20 $x21 $x22 $x23 $x24 $x25 $x26 $x27 $x8_pd $x18_pd $x20_pd $x22_pd $x24_pd $x26_pd>, implicit-def dead $x1, implicit killed $x10, implicit-def $x2, implicit-def $x10, debug-location !1460; jira.c:835:6