[llvm-dev] Relation between Register and MCRegister

Quentin Colombet via llvm-dev llvm-dev at lists.llvm.org
Tue Sep 29 09:28:24 PDT 2020


+ Daniel who added the MCRegister class.

Ah sorry, I replied too fast.
I mixed up MCPhysReg with MCRegister.

I was not aware we had such class.

From a look at it, MCRegister are essentially the same thing as Register. I am guessing that the difference is Register is used in the CodeGen layer, while MCRegister are used in the MC layer.

Until recently Register were just plain unsigned types and we introduced it to have stronger type checking. I don’t know what’s the rationale for MCRegister. It looks redundant to be honest. Maybe it is just solving a layering violation issue.

Let Daniel comment on that.

Cheers,
-Quentin

> On Sep 29, 2020, at 9:12 AM, Mircea Trofin <mtrofin at google.com> wrote:
> 
> 
> 
> On Tue, Sep 29, 2020 at 9:08 AM Quentin Colombet <qcolombet at apple.com <mailto:qcolombet at apple.com>> wrote:
> Hi,
> 
> Register can represent virtual or physical registers.
> MCRegister can only represent physical registers.
> 
> That's what I thought, but MCRegister has some stack slot APIs. 
> 
> 
> Eventually all Register instances are replaced by a MCRegister. 
> 
> What happens in that case to the stack slot APIs?
>  
> 
> Cheers,
> -Quentin
> 
> > On Sep 28, 2020, at 5:46 PM, Mircea Trofin via llvm-dev <llvm-dev at lists.llvm.org <mailto:llvm-dev at lists.llvm.org>> wrote:
> > 
> > Hello,
> > 
> > I'm trying to understand what the relation between these two types is: do we need them both? Register seems to be delegating to MCRegister without owning any new additional responsibilities.
> > 
> > Thanks!
> > _______________________________________________
> > LLVM Developers mailing list
> > llvm-dev at lists.llvm.org <mailto:llvm-dev at lists.llvm.org>
> > https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev <https://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/20200929/14fa96b8/attachment.html>


More information about the llvm-dev mailing list