<table border="1" cellspacing="0" cellpadding="8">
    <tr>
        <th>Issue</th>
        <td>
            <a href=https://github.com/llvm/llvm-project/issues/62661>62661</a>
        </td>
    </tr>

    <tr>
        <th>Summary</th>
        <td>
            Missing entry value debug location for inlined function parameter
        </td>
    </tr>

    <tr>
      <th>Labels</th>
      <td>
            debuginfo
      </td>
    </tr>

    <tr>
      <th>Assignees</th>
      <td>
      </td>
    </tr>

    <tr>
      <th>Reporter</th>
      <td>
          dstenb
      </td>
    </tr>
</table>

<pre>
    LLVM trunk f7cd55f56e9413f37474c8c12fc0a6231bf5fca5.

Related to umbrella ticket #43461.

Compiling the given program:

```
volatile int global;

static inline void inlined(int ip) {
  global = ip;
 __asm volatile ("" : : : "edi");
  global = 456; // line 6
}

void callee(int p) __attribute__((noinline)) {
 inlined(p);
}

int main() {
  callee(123);
  return 0;
}
```

using:

```
clang -g -S -O3 -o - entry_value_inline.c
```

gives:

```
        #DEBUG_VALUE: callee:p <- $edi
        #DEBUG_VALUE: inlined:ip <- $edi
        .loc 0 4 10 prologue_end             # entry_value_inline.c:4:10
        movl %edi, global(%rip)
        .loc    0 5 3                           # entry_value_inline.c:5:3
        #APP
        #NO_APP
.Ltmp0:
 #DEBUG_VALUE: callee:p <- [DW_OP_LLVM_entry_value 1] $edi
        .loc 0 6 10                          # entry_value_inline.c:6:10
 movl    $456, global(%rip)              # imm = 0x1C8
```

Here, we should be able to insert a entry-value debug location for `ip`:

```
#DEBUG_VALUE: inlined:ip <- [DW_OP_LLVM_entry_value 1] $edi
```

at `.Ltmp0`.

It was a while since I looked at this, but I think in general entry value debug locations are not emitted for variables originating from inlined functions.
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJycVcFu4zYQ_Rr6MrAhkaIsH3Rw4k27QLYJWuz2KFDiSGZDkQZJOd2_L0g7iZ24blDBli2J8-a9N6Oh8F4NBrEm_IbwzUxMYWtdLX1A085aK3_W9_c_vkFwk3mCftlJznte4qrIWc-WxbLoqi6nfZeJ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