[LLVMdev] Named Register Implementation

Joerg Sonnenberger joerg at britannica.bec.de
Mon Mar 31 09:01:53 PDT 2014


On Mon, Mar 31, 2014 at 03:50:43PM +0000, Robinson, Paul wrote:
> > -----Original Message-----
> > From: llvmdev-bounces at cs.uiuc.edu [mailto:llvmdev-bounces at cs.uiuc.edu]
> > On Behalf Of Joerg Sonnenberger
> > Sent: Saturday, March 29, 2014 6:37 AM
> > To: llvmdev at cs.uiuc.edu
> > Subject: Re: [LLVMdev] Named Register Implementation
> > 
> > On Sat, Mar 29, 2014 at 12:36:45PM +0000, Renato Golin wrote:
> > > On 29 March 2014 12:27, Joerg Sonnenberger <joerg at britannica.bec.de>
> > wrote:
> > > > declare void @llvm.write_register(i32 regno, i32 val)
> > > > declare i32 @llvm.read_register(i32 regno)
> > > >
> > > > where regno is the DWARF name or a special reservation e.g. for IP
> > or
> > > > SP.
> > >
> > > Do front-ends have that info with them? AFAICR, front-ends only emit
> > > metadata related to variables and they let the lowering process to
> > > deal with location. I want to add as little as possible to front-ends
> > > on this.
> > 
> > I'm not sure if we have a generic mapping of textual name to DWARF name
> > right now, but that would be easy to provide. In terms of lowering, this
> > would be another mode like TLS already is?
> 
> DWARF "names" are just small integers with a target-specific mapping
> to the target-specific register set. You really can't assume anything
> specific about any given DWARF register number in a target-independent
> way, which I think is what you're asking about.  (DWARF doesn't define
> that mapping.)

We don't have to assume anything in the frontend. It is really just a
question of "do we already provide a way to map "target,regname" to
"regno".

Joerg



More information about the llvm-dev mailing list