[lld] [llvm] [ICF] Add a NOP after branch in ICF thunk to improve debugability (PR #154986)

Peter Rong via llvm-commits llvm-commits at lists.llvm.org
Wed Aug 27 13:28:31 PDT 2025


DataCorrupted wrote:

> any of those values would be OK, doesn't matter if the padding is included in the function or not)

I agree, if the last row's address is not considered as part of the Sequence, it shouldn't bother with symbolication. 

If we agree that its `-mllvm -emit-func-debug-line-table-offsets` itself, not the linetable that's buggy, let me draft a patch to update how this `end_seqence` is emitted. We could emit an `DW_LNS_advance_pc` by `MinInstLength` before `DW_LNE_end_sequence`:

```
0x00000058: 05 DW_LNS_set_column (12)
0x0000005a: 0a DW_LNS_set_prologue_end
0x0000005b: 00 DW_LNE_set_address (0x0000000000000000)
0x00000066: 01 DW_LNS_copy
            0x0000000000000000      1     12      1   0             0       0  is_stmt prologue_end
0x00000067: 00 DW_LNE_end_sequence
            0x0000000000000000      1     12      1   0             0       0  is_stmt end_sequence
0x0000006a: 05 DW_LNS_set_column (12)
0x0000006c: 0a DW_LNS_set_prologue_end
0x0000006d: 00 DW_LNE_set_address (0x0000000000000010)
0x00000078: 13 address += 0,  line += 1,  op-index += 0
            0x0000000000000010      2     12      1   0             0       0  is_stmt prologue_end
0x00000079: 00 DW_LNE_end_sequence
            0x0000000000000010      2     12      1   0             0       0  is_stmt end_sequence
0x0000007c: 05 DW_LNS_set_column (12)
0x0000007e: 0a DW_LNS_set_prologue_end
0x0000007f: 00 DW_LNE_set_address (0x0000000000000020)
0x0000008a: 14 address += 0,  line += 2,  op-index += 0
            0x0000000000000020      3     12      1   0             0       0  is_stmt prologue_end
0x0000008b: 02 DW_LNS_advance_pc (addr += 1, op-index += 0)
0x0000008d: 00 DW_LNE_end_sequence
            0x0000000000000021      3     12      1   0             0       0  is_stmt end_sequence
```

https://github.com/llvm/llvm-project/pull/154986


More information about the llvm-commits mailing list