I've been playing around with EA for a while now a...
# kotlin-native
a
I've been playing around with EA for a while now and i am at a point where i gather the lifetimes of all callsites related to interop allocations. I also have a post-EA transformation pass during LTO which then takes that data and attempts to lower applicable allocations into stack allocations. The only problem i'm facing now is that the EA algorithm itself is fairly complex and i have trouble understanding how i should take these allocations properly into account, i'm getting GLOBAL for all my interop allocations right now even tho most of them should be STACK @sergey.bogolepov Do you maybe have a good starting point you can point me to?
s
Hey. It makes sense to take a look at Alloc class in DFG IR. It is already have a special case for array allocation, so maybe adding another special case for
MemScope.alloc
might be a good starting point. The guy who has worked on it is currently on vacation. I'll ask him for more tips once he gets back.
🙌 1
❤️ 1
a
Thank you so much! 🙂 And sorry for directly bugging you on here.