Function register clobber propagation

Hi all,

Does LLVM currently have any way to exploit known register usage of already-compiled callee functions within a module to reduce register pressure in calling functions? GCC does this, but I haven’t seen any sign of this being done (having checked on a couple of different target architectures), and can’t find any mention of such optimisation in the source.

Have I overlooked something? Or is there a rationale for not attempting this? (Such as limiting potential parallelism in compiling a module)


There is at least some minimal support for this, see CodeGen/RegUsageInfoPropagate.cpp (and related). This interprocedural register allocation is enabled with “-enable-ipra”.

Ah! Excellent. This looks like just what I’m looking for, thanks for the pointer!