On Sat, Mar 29, 2014 at 11:46:13AM +1030, Jeremy Lakeman wrote:> declare void @llvm.write_register.sp(i32 val) > declare i32 @llvm.read_register.sp()I'd prefer to use 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. Joerg
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. If they do have, it should be trivial to translate between Dwarf registers to TLI ones. cheers, --renato
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? Joerg