[LLVMdev] Physical register reuse during register allocation

Tim Northover t.p.northover at gmail.com
Wed Jul 16 09:56:31 PDT 2014


> Can you point me to the code where I can access this data structure and
> modify it accordingly? Basically, when does the backend pick a specific
> physical register as an instruction's destination.

LLVM has multiple register allocators, living in
lib/CodeGen/RegAlloc*.cpp. 2 out of the 4 seem to use the
"AllocationOrder" class which you might be able to fiddle for your
purposes (possibly via the TargetRegisterInfo::getRegAllocationHints
function).

But at a glance, it looks like we don't have *any* policy on recently
used registers at the moment. So support for tuning based on recent
use may be lacking in either direction.

Cheers.

Tim.



More information about the llvm-dev mailing list