Manage memories

I have project of build LLVM backend for specific architecture.
I add some core instructions, and now i want to be able to manage the memories in terms of global variables, stack variables, data and etc.
Someone have any suggestions for relevant sources to learn how to do it?

Thanks alot,
Good health for everyone!