[LLVMdev] [PATCH] RegScavenger::scavengeRegister

Jakob Stoklund Olesen stoklund at 2pi.dk
Tue Apr 9 16:35:46 PDT 2013


On Apr 9, 2013, at 3:57 PM, Akira Hatanaka <ahatanak at gmail.com> wrote:

> Is there a way to force or increase the likelihood of rematerialization of condition registers, instead of copying or spilling?
> 
> mips isa doesn't have a handy instruction which enables reading or writing condition registers in one or two cycles (you need several shift and masking operations), so it makes more sense to rematerialize, if that's possible.

Cheap-as-a-copy remat is always preferred to inserting a COPY instruction, but only if the operands to the rematted instructions are already available at the new location.

RA won't extend live ranges for a remat, but I can see how that would be useful in your case.

It gets complicated if the virtual registers used have multiple values - you would need to prove that the same value is available at the new location.

LiveRangeEdit has the remat code.

/jakob





More information about the llvm-dev mailing list