LiveIntervals for FunctionPass

Is there an equivalent to LiveIntervals that works at the Function level? If not, is there anything that makes it difficult to implement compared to the MachineFunction version?


I am not sure what you mean. Live interval analysis is done at the function level.


It’s done at the MachineFunctionPass level as far as I can tell ( I’d like something at the FunctionPass level.

Ok. If it’s at llvm ir level, it’s very simple since everything is in SSA form. What are you trying to achieve though?


Static profiling. Trying to implement “Statis Branch Frequency and Program Profile Analysis” by We and Larus, 1994 or some similar algorithm. Attempts to do it as a MachineFunctionPass didn’t work out, as type information was lost. It’s important to know what’s a pointer for the described algorithm.