Finding Privatizable Variables/Arrays

Hello everyone,

Is there any support for finding privatizable variables or arrays in LLVM? Any existing code that I can make use of to find privatizable objects even in trivial settings?

I understand that finding privatizable variables (conservatively) is extremely difficult in most of the programs and so, I was wondering if anyone has tried implementing it or has even implemented a toy analysis pass that detects privatizable variables in trivial programs.

If not, any help on how to approach this problem would be immensely helpful.

Thank you.

Regards,
Malhar Thakkar