[llvm-dev] [inline-asm][asm-goto] Supporting "asm goto" in inline assembly
Chandler Carruth via llvm-dev
llvm-dev at lists.llvm.org
Thu Mar 30 01:20:44 PDT 2017
On Wed, Mar 29, 2017 at 9:38 AM Yatsina, Marina via llvm-dev <
llvm-dev at lists.llvm.org> wrote:
> Hi,
>
>
>
> I wanted to revive this issue of supporting asm goto (*Bug 9295*
> <https://bugs.llvm.org/show_bug.cgi?id=9295>).
>
FWIW, my opinion is that the use cases don't really justify the complexity
this adds to the compiler. I feel like embedding inline assembly into
normal C control flow constructs and writing the entire thing directly give
pretty reasonable options.
But maybe others really see high-value reasons to add support for this...
If they do...
As was already proposed, the best way seems to be introducing new IR.
>
> If we’re changing the IR, we should probably provide an infrastructure
> that solves or at least enables future support for things like:
>
> 1. MS-style inline asm jmps and goto (*Bug 24529*
> <https://bugs.llvm.org/show_bug.cgi?id=24529>)
>
I *strongly* agree with the 'WONTFIX' resolution here. More than GCC's "asm
goto", this feature seems much more harmful to the compiler and much less
well motivated.
> 2. Analyzing symbols defined/references in the inline assembly (
> *Bug 28970* <https://bugs.llvm.org/show_bug.cgi?id=28970>), taking into
> account module/file-scope inline assembly.
>
Unless we decide to address #1 in some way, this seems completely
orthogonal to "asm goto". While I'd love to see a good resolution to
PR28970, I don't think it makes sense to couple the two together. Among
other things, none of my concerns about "asm goto" apply to simply exposing
the symbols defined.
> 3. Provide some information about the cost of the inline assembly?
> (I’m not sure if we want to couple it with this issue and if the cost
> should be represented in this new IR or some other way)
>
I suspect this too should be an orthogonal discussion.
I think we should expose a TTI-cost-analysis API and allow passing inline
assembly to it. Then targets can, if they choose, actually analyze the
assembly to compute a cost. But I don't think we need IR changes here and
even if we do, likely orthogonal ones to "asm goto".
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20170330/885a8b6f/attachment.html>
More information about the llvm-dev
mailing list