<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
</head>
<body>
This is a bit out of date, LLVM now has a stack-based target
included by default - WebAssembly. It has a "stackifier"
implementation (look for files with Stackify in the name inside
llvm/lib/Target/WebAssembly). However, stack transformations are in
fact somewhat of a pain point, that's one of the reasons Emscripten
(C/C++ to Wasm compiler) uses an additional tool after emitting code
using Clang/LLVM, though another popular Wasm toolchain does not.<br>
<br>
Best,<br>
Petr<br>
<p><br>
</p>
<p><br>
</p>
<div class="moz-cite-prefix">On 4/29/21 10:06 AM, Quentin Colombet
via llvm-dev wrote:<br>
</div>
<blockquote type="cite"
cite="mid:4C2A6327-68B5-4D67-8060-F923E74D1B1D@apple.com">
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
Hi Xiaohui,
<div class=""><br class="">
</div>
<div class="">I think the situation didn’t really change with
respect to what you found.</div>
<div class="">In particular I believe the advice from Chris that
you already found (<a
href="https://lists.llvm.org/pipermail/llvm-dev/2008-November/018626.html"
class="" moz-do-not-send="true">https://lists.llvm.org/pipermail/llvm-dev/2008-November/018626.html</a>)
is the best thing you can do right now.</div>
<div class=""><br class="">
</div>
<div class="">Cheers,</div>
<div class="">-Quentin<br class="">
<div><br class="">
<blockquote type="cite" class="">
<div class="">On Apr 28, 2021, at 11:17 PM, Xiaohui Liu via
llvm-dev <<a href="mailto:llvm-dev@lists.llvm.org"
class="" moz-do-not-send="true">llvm-dev@lists.llvm.org</a>>
wrote:</div>
<br class="Apple-interchange-newline">
<div class="">
<div dir="ltr" class="">Hi all,
<div class=""><br class="">
</div>
<div class="">I am developing a high-level language that
compiles to bytecode for a stack-based virtual
machine. There are only two stacks similar to <a
href="https://en.wikipedia.org/wiki/Forth_(programming_language)"
class="" moz-do-not-send="true">Forth</a>.</div>
<div class=""><br class="">
</div>
<div class="">LLVM IR seems register-machine oriented
and most backends target register machines. I have
seen several attempts to use it for a stack machine
backend, such as <a
href="https://lists.llvm.org/pipermail/llvm-dev/2009-February/020335.html"
target="_blank" class="" moz-do-not-send="true">this</a>,
<a
href="https://lists.llvm.org/pipermail/llvm-dev/2008-November/018626.html"
target="_blank" class="" moz-do-not-send="true">this</a>,
and <a
href="https://lists.llvm.org/pipermail/llvm-dev/2006-August/006460.html"
target="_blank" class="" moz-do-not-send="true">this</a>.
What is the state of the art of using LLVM to optimize
for a stack machine? Or LLVM is not a good choice for
this job?</div>
<div class=""><br class="">
</div>
<div class="">Regards,</div>
<div class="">Xiaohui</div>
</div>
_______________________________________________<br
class="">
LLVM Developers mailing list<br class="">
<a href="mailto:llvm-dev@lists.llvm.org" class=""
moz-do-not-send="true">llvm-dev@lists.llvm.org</a><br
class="">
<a class="moz-txt-link-freetext" href="https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev">https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev</a><br
class="">
</div>
</blockquote>
</div>
<br class="">
</div>
<br>
<fieldset class="mimeAttachmentHeader"></fieldset>
<pre class="moz-quote-pre" wrap="">_______________________________________________
LLVM Developers mailing list
<a class="moz-txt-link-abbreviated" href="mailto:llvm-dev@lists.llvm.org">llvm-dev@lists.llvm.org</a>
<a class="moz-txt-link-freetext" href="https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev">https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev</a>
</pre>
</blockquote>
</body>
</html>