<table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Issue</th>
<td>
<a href=https://github.com/llvm/llvm-project/issues/64239>64239</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>
Allow reserving CPU registers at block level
</td>
</tr>
<tr>
<th>Labels</th>
<td>
new issue
</td>
</tr>
<tr>
<th>Assignees</th>
<td>
</td>
</tr>
<tr>
<th>Reporter</th>
<td>
KOLANICH
</td>
</tr>
</table>
<pre>
Related: #64232
[According to GCC docs](https://gcc.gnu.org/onlinedocs/gcc/extensions-to-the-c-language-family/how-to-use-inline-assembly-language-in-c-code.html#local-register-variables)
```c++
register uint64_t a asm ("%rax");
```
syntax doesn't reserve a register, it just allows to pass info to and from `asm` blocks.
It'd be nice to have some syntax allowing to guide a compiler into avoiding cloberring a register for anything else, and restore it before the places it is used if any places where the compiler couldn't proove it is unused had happenned.
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJxcU12vozYQ_TXmZQQiNh_hgYfcRGlXrdqqUp8rYw_grbGRxyQ3_74yN9m7u5IB45lz5ng-JJGZHGLP6jdWXzK5xdmH_rc_fz_98eX8azZ4_ej_RisjaiZOwLhoKi44Ky-sPD3f9dtJKR-0cRNED7-cz6C9IlZfGD_OMa7ExInxK-PXSaliclvhw8T41TtrHO6-u4nxK75HdGS8ozz6PM6Yq9xKN21ywnyUi7EPxq-zvyfzRpibnSOXRLgM9vHpbFyucuU1FnNcLOPCeiVtHnAyFDHkNxmMHCwS490P12nKj6UYf0trP33BYDMuNtW_ESRIWoDxI-Oc8TrI933TMfH2E9H37PRwUb6D9kiO8TZCQMJwQ5DwCsH4GUyErxtFkNb6O6WsrpIIjBt9-pFOwxj8AqwpJS2sKWGwXv1HxfexvkTGWw0DgjMKE26WNwTyC8JTx87_rNu0GZ10KL-sxmIA41Komzd7ZZX1A4aQtp9aYfQBpHvEOZ2jJUzqk7yAFH3AdJMBx7SLM8JqpUJKh4ZgI9RgxoR_Ge4zPj2_qVB-s_ojV2vw_oYvtNvxs0zPuqJzqItM90J3opMZ9oemK1txrLsqm_uqbZqyOdRay66Vx6YrD11d13isG9nqkWem5yUXZSvKQysaURXH-ija8aBxxEocOsGqEhdpbGHtbUkNnBmiDfs0D11m5YCW9jHi3OEddmPqiPqShT5h8mGbiFWlNRTpkyWaaLE_pUI8myGl8vzXP9-STCDjR33B4g1ttgXb_zRXJs7bUCi_MH5N1M9Pvgb_FVVk_LoLSoO2C_4_AAD__-q1Sq0">