[llvm-dev] Checking when Register Allocation has been performed

Martin J. O'Riordan via llvm-dev llvm-dev at lists.llvm.org
Mon Jan 15 13:03:23 PST 2018


Thanks Craig,

 

Is asking if the MF has the NoVRegs property okay?  My clunky hack does something similar I must admit, currently I use ‘bool isPostRA = (MF.getRegInfo().getNumVirtRegs() == 0);’ and your suggestion is semantically very similar, though with a more official stamp :)

 

All the best,

 

            MartinO

 

From: Craig Topper [mailto:craig.topper at gmail.com] 
Sent: 15 January 2018 20:26
To: Martin J. O'Riordan <MartinO at theheart.ie>
Cc: LLVM Developers <llvm-dev at lists.llvm.org>
Subject: Re: [llvm-dev] Checking when Register Allocation has been performed

 

Maybe  MF.getProperties().hasProperty(MachineFunctionProperties::Property::NoVRegs))?




~Craig

 

On Mon, Jan 15, 2018 at 12:07 PM, Martin J. O'Riordan via llvm-dev <llvm-dev at lists.llvm.org <mailto:llvm-dev at lists.llvm.org> > wrote:

Hi LLVM Devs,

 

I have some shared code that performs lowering operations that can occur before or after register allocation.  When it is pre-RA I want to only use virtual registers for intermediate results, but post-RA I have to use only a very restricted set of physical registers.

 

Code generation using the restricted set is not as efficient as it is when I can use virtual registers.  At the moment I have a clunky implementation for checking whether or not the register allocator has been run, and I am wondering if there is a “correct way” of checking whether the RA pass has been run?  Some part of the register info API that I have missed perhaps?

 

Thanks,

 

            MartinO

 


_______________________________________________
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

 

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20180115/c9c63a7c/attachment.html>


More information about the llvm-dev mailing list