I would like to know what register scavenging is, but reading
RegisterScavenging.h [1]
and googling don't help too much. Could someone explain it a little
bit (what it is and when
we need it), or point me to some nice link, I will be very appreciated. :-)
[1] http://llvm.org/docs/doxygen/html/RegisterScavenging_8h_source.html
Regards,
chenwj
--
Wei-Ren Chen (陳韋任)
Homepage: https://people.cs.nctu.edu.tw/~chenwj
_______________________________________________
LLVM Developers mailing list
llvm...@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev
On 2 April 2017 at 07:21, 陳韋任 via llvm-dev <llvm...@lists.llvm.org> wrote:
> I would like to know what register scavenging is, but reading
> RegisterScavenging.h [1] and googling don't help too much. Could someone explain it a little
> bit (what it is and when we need it), or point me to some nice link, I will be very appreciated. :-)
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.
It's not commonly used (better to arrange to have a register allocated
for you if possible), but occasionally helpful in things like frame
lowering.
Cheers.
Tim.
[*] This is where the "scavenger" name comes from: hunting around for
discarded registers sort of like the animals.
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.