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

    <tr>
        <th>Summary</th>
        <td>
            [clang][inline asm][arm] difficulty using `.save` and `.pad` directives in inline asm
        </td>
    </tr>

    <tr>
      <th>Labels</th>
      <td>
            bug,
            clang,
            backend:ARM
      </td>
    </tr>

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

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

<pre>
    via https://github.com/ClangBuiltLinux/linux/issues/1718, it looks like we're unable to use `.save` and `.pad` directives in inline asm for EABI unwind hints since the integrated assembler requires a corresponding `.fnstart` directive, but doesn't seem to have the context that the compiler will be generating those directives.

```
arch/arm/probes/kprobes/core.c:409:30: error: .fnstart must precede .save or .vsave directives
                "stmdb  sp, {sp, lr, pc}        \n\t"
                                                  ^
<inline asm>:3:2: note: instantiated into assembly here
        .save   {sp, lr, pc}
        ^
arch/arm/probes/kprobes/core.c:412:29: error: .fnstart must precede .pad directive
                "stmdb  sp!, {r0 - r11}         \n\t"
                                                  ^
<inline asm>:6:2: note: instantiated into assembly here
        .pad    #52
        ^
2 errors generated.
```

cc @loganchien @nathanchance 
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJy1VNuOnDAM_Rp4sRZBGJjhgYe5bKVK7Uv_IAkeSCck0yTMdv--DnPbrbbtVlVRSOwQbJ9jx8J2z-1JcRhCOPqkXCfsA41ehWESmbQjKVvNTb-ZlA6flJm-046-rMr7CT0JxbJYJWwLKoC29uBBqwPCEyZs6RAmw4VGCBYmj5DUeeb5CWkFbrpZP_Iuqp1yKIM6oQdlaJAfBO5H2FsHj-vNRzL1pOifQZngwSsjyeyAdDRg73jAjo57HMmdA4ffJjLogYO0joSjNZ0y_exxb3zgLrzyGhGIKUBn0RsKPYBHHGPcA8U7O5KWPH0PJPNw2RiPKnp7UlqDQOjRIEUS_YTBEt47qCzJd0m-vsx1fhmzyp0ciEjuIuNHZ8XM6-EmEQLMJCVokTc0lzlNgM5ZF4UrHBgnH-BIDrFDmGkGoi47zdI9krNP-OlJGPNh7ASAP0YukuXmLGgX56NMlrvb2Wpr6A30z9vG_vwk1eOFinJ7z3VSPkZ89LKIzNiAcVURoAlqzjGl214T_QwDOnwdwxk4vAng9clbDO_nv4hxseY9_FNZv6iud3BeXGh3OTyAK4oXhP9vxut_YzxCneGUFfsFxezMl79eEeyyN6_CeZYSkkWubc-NHBSaqBlO945UHu99im1R1wtW1KumSbu27Jqy4WlQQWObVBsZ21ZS7Uh8gXXWY5arHaVmv1dy0uGZGtO1Mfxla0onp9vfNE-tT9flgYrpKxl52TirZdOU6dByXhYcBUPcL4tarsq8WPLFQjQl48WiEKnmArWPuCj_YupjFcRaYeyM86YKLg9oOopm_eVz3K52qWpZzljesLpYsVWxygSvllyIRpRcVrKuiVscudJZjDOzrk9dO4dMnnxMg_LB3z9SIaje4ExztM8nanWuNUoeOvR80kah8-mMsp0h_gByyOX7">