Gleb Popov via llvm-dev
2018-Dec-24 06:18 UTC
[llvm-dev] Tablegen: frameindex matches register
Hello. In my backend I have following definition: def StoreStackR : MyInst<2, (outs), (ins IntRegs:$addr, IntRegs:$reg), "store $reg, [$addr]", [(store i32:$reg, frameindex:$addr)]>; However, LLVM generates both storestackr %reg1, [%reg2] and storestackr %reg1, [123123] using this definition. I was expecting that "IntRegs:$addr" would constrain it to registers only. As consequence, I can't infer operand type from the opcode. What's the proper way to solve this? Thanks in advance. -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20181224/dbc9d57d/attachment.html>
Krzysztof Parzyszek via llvm-dev
2018-Dec-24 18:37 UTC
[llvm-dev] Tablegen: frameindex matches register
There is no way to match frameindex in TableGen (unless something has changed recently). Use ComplexPattern instead. We do that on Hexagon, grep for AddrFI. -Krzysztof On 12/24/2018 12:18 AM, Gleb Popov via llvm-dev wrote:> Hello. > > In my backend I have following definition: > > def StoreStackR : MyInst<2, (outs), (ins IntRegs:$addr, IntRegs:$reg), > "store $reg, [$addr]", [(store i32:$reg, > frameindex:$addr)]>; > > However, LLVM generates both > > storestackr %reg1, [%reg2] > > and > > storestackr %reg1, [123123] > > using this definition. I was expecting that "IntRegs:$addr" would > constrain it to registers only. As consequence, I can't infer operand > type from the opcode. What's the proper way to solve this? > > Thanks in advance. > > <http://www.avg.com/email-signature?utm_medium=email&utm_source=link&utm_campaign=sig-email&utm_content=emailclient> > Virus-free. www.avg.com > <http://www.avg.com/email-signature?utm_medium=email&utm_source=link&utm_campaign=sig-email&utm_content=emailclient> > > > <#DAB4FAD8-2DD7-40BB-A1B8-4E2AA1F9FDF2> > > _______________________________________________ > LLVM Developers mailing list > llvm-dev at lists.llvm.org > http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev >