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

James Y Knight via llvm-dev llvm-dev at lists.llvm.org
Tue Apr 4 12:27:40 PDT 2017


On Tue, Apr 4, 2017 at 2:12 PM, Matthias Braun <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."

You can still have register clobbers, which I suppose might trigger the
same failure case?
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20170404/434db0ec/attachment.html>


More information about the llvm-dev mailing list