Hong Hu via llvm-dev
2017-Jan-19 12:36 UTC
[llvm-dev] Spare Register at one Machine Instruction
Hi All, Given a machine instruction, is it possible to tell which register(s) is still not in use? For example, given one instruction A, if the one follows it (say B) defines register rax, then I can tell rax should spare at instruction A. The purpose is to use the spare register to replace registers used by A, for instrumentation purpose. Regards, Hu Hong -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20170119/499daf9d/attachment.html>
Nemanja Ivanovic via llvm-dev
2017-Jan-19 13:50 UTC
[llvm-dev] Spare Register at one Machine Instruction
I believe what you're after is the register scavenger. It's in: include/llvm/CodeGen/RegisterScavenging.h Implementation: lib/CodeGen/RegisterScavenging.cpp On Thu, Jan 19, 2017 at 1:36 PM, Hong Hu via llvm-dev < llvm-dev at lists.llvm.org> wrote:> Hi All, > > Given a machine instruction, is it possible to tell which register(s) is > still not in use? > > For example, given one instruction A, if the one follows it (say B) > defines register rax, then I can tell rax should spare at instruction A. > > The purpose is to use the spare register to replace registers used by A, > for instrumentation purpose. > > Regards, > Hu Hong > > _______________________________________________ > LLVM Developers mailing list > llvm-dev at lists.llvm.org > http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev > >-------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20170119/445ccafc/attachment.html>
Matthias Braun via llvm-dev
2017-Jan-19 19:55 UTC
[llvm-dev] Spare Register at one Machine Instruction
There is also the LivePhysReg facility that I would recomment if you just want to query for a free register and do not need the full feature set of the RegisterScavenger. - Matthias> On Jan 19, 2017, at 5:50 AM, Nemanja Ivanovic via llvm-dev <llvm-dev at lists.llvm.org> wrote: > > I believe what you're after is the register scavenger. > It's in: include/llvm/CodeGen/RegisterScavenging.h > Implementation: lib/CodeGen/RegisterScavenging.cpp > > On Thu, Jan 19, 2017 at 1:36 PM, Hong Hu via llvm-dev <llvm-dev at lists.llvm.org <mailto:llvm-dev at lists.llvm.org>> wrote: > Hi All, > > Given a machine instruction, is it possible to tell which register(s) is still not in use? > > For example, given one instruction A, if the one follows it (say B) defines register rax, then I can tell rax should spare at instruction A. > > The purpose is to use the spare register to replace registers used by A, for instrumentation purpose. > > Regards, > Hu Hong > > _______________________________________________ > LLVM Developers mailing list > llvm-dev at lists.llvm.org <mailto:llvm-dev at lists.llvm.org> > http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev <http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev> > > > _______________________________________________ > LLVM Developers mailing list > llvm-dev at lists.llvm.org > http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev-------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20170119/f015a582/attachment-0001.html>