[llvm-dev] What is register scavenging?

陳韋任 via llvm-dev llvm-dev at lists.llvm.org
Sun Apr 2 15:56:48 PDT 2017


>
> It's a helper for passes that run after register allocation but still
> need a new register they can use without breaking anything. It looks
> around nearby instructions[*] to see if there's anything it can prove
> is unused at the moment, and as a last ditch effort can spill
> registers to the stack.
>

​I am reading TriCore document [1]​. It mention  `eliminateFrameIndex`,
which is a pass after register allocation,
translates virtual stack slot reference to a register-offset pair. If the
offset is too large, additional instructions are
needed to compute the effective address, which need more register after the
register allocation. Now comes the
register scavenging.

Now I understand what it said after your help.

One last point, I am not native English speaker.  By "as a last ditch
effort can spill registers to the stack.", you
mean if register scavenging cannot save us, then we have to do the spilling?

Thanks.

​[1]
https://wwwcip.informatik.uni-erlangen.de/~sicherha/foo/tricore-llvm.pdf​

Regards,
chenwj
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20170403/b8ccc574/attachment.html>


More information about the llvm-dev mailing list