[llvm-dev] [inline-asm][asm-goto] Supporting "asm goto" in inline assembly

Matthias Braun via llvm-dev llvm-dev at lists.llvm.org
Tue Apr 4 13:09:56 PDT 2017


> On Apr 4, 2017, at 12:27 PM, James Y Knight via llvm-dev <llvm-dev at lists.llvm.org> wrote:
> 
> On Tue, Apr 4, 2017 at 2:12 PM, Matthias Braun <matze at braunis.de <mailto:matze at braunis.de>> wrote:
> - The register allocator fails when the terminator instruction also writes a register which is subsequently spilled (none of the existing targets does that, but you could specify this situation in inline assembly).
> 
> You can't actually have outputs from an asm goto in the GCC implementation (and I'd suggest leaving that restriction in the LLVM implementation too if it makes the implementation easier).
> 
> From GCC docs <https://gcc.gnu.org/onlinedocs/gcc-6.3.0/gcc/Extended-Asm.html>:
> "This form of asm is restricted to not have outputs. This is due to a internal restriction in the compiler that control transfer instructions cannot have outputs. This restriction on asm goto may be lifted in some future version of the compiler. In the meantime, asm goto may include a memory clobber, and so leave outputs in memory."
Ah that is convenient :)

> 
> You can still have register clobbers, which I suppose might trigger the same failure case?
clobbers are less of a problem as there is no reason to spill a register that is just clobbered by a regmask.

- Matthias
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20170404/8b0661d4/attachment.html>


More information about the llvm-dev mailing list