<div dir="ltr">Hi all,<div><br></div><div>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)">Forth</a>.</div><div><br></div><div>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">this</a>, <a href="https://lists.llvm.org/pipermail/llvm-dev/2008-November/018626.html" target="_blank">this</a>, and <a href="https://lists.llvm.org/pipermail/llvm-dev/2006-August/006460.html" target="_blank">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><br></div><div>Regards,</div><div>Xiaohui</div></div>