[llvm-dev] LLVM Backend for a platform with no (normal) stack (original) (raw)

Bruce Hoult via llvm-dev llvm-dev at lists.llvm.org
Mon Dec 17 06:28:21 PST 2018


On Mon, Dec 17, 2018 at 6:14 AM Mendell, Mark P <mark.p.mendell at intel.com> wrote:

For a machine like an FPGA with no stack, you have to ensure that you have an optimization that rewrites the alloca into either registers (such as PromoteMem2Reg) or that you rewrite the alloca by declaring a static local, and rewriting the code to use that instead of the alloca result.

You'll then have to make sure programs never have recursion.

When it comes down to it, nothing we run programs on actually has a true unbounded stack. We just have a region of memory that we calculate or hope will be big enough. But over a million people (mostly amateurs) happily and regularly run C++ programs (with virtual functions and all) compiled by gcc on machines with only 2 KB of RAM: the ATmega328 in most Arduinos. -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20181217/29589480/attachment.html>



More information about the llvm-dev mailing list