[llvm-dev] `free` counterpart to `alloca`, or way to lift to function home

edA-qa mort-ora-y via llvm-dev llvm-dev at lists.llvm.org
Sun Mar 18 02:46:49 PDT 2018


I'm unintentionally allocating too much space on the stack by using
`alloca` inside a loop.

To fix this I will do my `alloca` outside of the loop itself.  I'm
wondering if there is a way for this to be automatically done: given
alloca a function scope, rather than loop scope.

I'm curious also, since this actually allocates each time in the loop,
is there a way to say the stack allocations are no longer required and
return to an early stack position?  My `alloca` will always be in order,
in a tree, thus it'd be safe to return to an early allocation point.


-- 
edA-qa mort-ora-y  
	http://mortoray.com/

Creator of the Leaf language
	http://leaflang.org/

Streaming algorithms, AI, and design on Twitch
	https://www.twitch.tv/mortoray

Twitter
	edaqa
	



More information about the llvm-dev mailing list