Rail Shafigulin via llvm-dev
2016-Feb-18 18:43 UTC
[llvm-dev] How to interpret Selection DAG error output
I recently had to change some DAG patterns for my target. Conceptually I understand what DAG patterns are and what is their purpose, however given that I have quite vague understanding about how to LLVM implements and specifies them, naturally I got an error. Here it is Here is the error: LLVM ERROR: Cannot select: 0x3284268: glue = EsenciaISD::SET_FLAG 0x3283608, 0x3283710, 0x3283e48 [ORD=3] [ID=11] 0x3283608: i32,ch = CopyFromReg 0x3257980, 0x3283500 [ORD=1] [ID=9] 0x3283500: i32 = Register %vreg5 [ID=1] 0x3283710: i32 = Constant<3> [ID=2] 0x3283e48: i32 = Constant<20> [ID=8] In function: fib As far as I can understand LLVM cannot select it because the pattern is not specified. Unfortunately for me, I can't understand how to interpret this output. Would anybody be able to help me out? Any help is appreciated. -- Rail Shafigulin Software Engineer Esencia Technologies -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20160218/1a6a4d60/attachment.html>
Krzysztof Parzyszek via llvm-dev
2016-Feb-18 18:50 UTC
[llvm-dev] How to interpret Selection DAG error output
On 2/18/2016 12:43 PM, Rail Shafigulin via llvm-dev wrote:> > LLVM ERROR: Cannot select: 0x3284268: glue = EsenciaISD::SET_FLAG > 0x3283608, 0x3283710, 0x3283e48 [ORD=3] [ID=11] > 0x3283608: i32,ch = CopyFromReg 0x3257980, 0x3283500 [ORD=1] [ID=9] > 0x3283500: i32 = Register %vreg5 [ID=1] > 0x3283710: i32 = Constant<3> [ID=2] > 0x3283e48: i32 = Constant<20> [ID=8] > In function: fib > > As far as I can understand LLVM cannot select it because the pattern is > not specified. Unfortunately for me, I can't understand how to interpret > this output. Would anybody be able to help me out?The DAG node that has failed selection is "SET_FLAG %vreg5, 3, 20", the type of the node is "glue" and all 3 arguments are i32. The top line shows the node that caused the failure. The hex numbers on that line are the addresses of the arguments. These arguments are then listed below. Newer versions of LLVM show node ids instead of addresses, but AFAIK it was dependent on some configuration option. -Krzysztof -- Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum, hosted by The Linux Foundation
Rail Shafigulin via llvm-dev
2016-Feb-18 19:10 UTC
[llvm-dev] How to interpret Selection DAG error output
Thanks for the explanation. Do you know what ORD and ID mean? On Thu, Feb 18, 2016 at 10:50 AM, Krzysztof Parzyszek via llvm-dev < llvm-dev at lists.llvm.org> wrote:> On 2/18/2016 12:43 PM, Rail Shafigulin via llvm-dev wrote: > >> >> LLVM ERROR: Cannot select: 0x3284268: glue = EsenciaISD::SET_FLAG >> 0x3283608, 0x3283710, 0x3283e48 [ORD=3] [ID=11] >> 0x3283608: i32,ch = CopyFromReg 0x3257980, 0x3283500 [ORD=1] [ID=9] >> 0x3283500: i32 = Register %vreg5 [ID=1] >> 0x3283710: i32 = Constant<3> [ID=2] >> 0x3283e48: i32 = Constant<20> [ID=8] >> In function: fib >> >> As far as I can understand LLVM cannot select it because the pattern is >> not specified. Unfortunately for me, I can't understand how to interpret >> this output. Would anybody be able to help me out? >> > > > The DAG node that has failed selection is "SET_FLAG %vreg5, 3, 20", the > type of the node is "glue" and all 3 arguments are i32. > > The top line shows the node that caused the failure. The hex numbers on > that line are the addresses of the arguments. These arguments are then > listed below. > > Newer versions of LLVM show node ids instead of addresses, but AFAIK it > was dependent on some configuration option. > > -Krzysztof > > > -- > Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum, hosted > by The Linux Foundation > _______________________________________________ > LLVM Developers mailing list > llvm-dev at lists.llvm.org > http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev >-- Rail Shafigulin Software Engineer Esencia Technologies -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20160218/b413da2b/attachment.html>
Rail Shafigulin via llvm-dev
2016-Feb-18 19:19 UTC
[llvm-dev] How to interpret Selection DAG error output
On Thu, Feb 18, 2016 at 10:50 AM, Krzysztof Parzyszek via llvm-dev < llvm-dev at lists.llvm.org> wrote:> On 2/18/2016 12:43 PM, Rail Shafigulin via llvm-dev wrote: > >> >> LLVM ERROR: Cannot select: 0x3284268: glue = EsenciaISD::SET_FLAG >> 0x3283608, 0x3283710, 0x3283e48 [ORD=3] [ID=11] >> 0x3283608: i32,ch = CopyFromReg 0x3257980, 0x3283500 [ORD=1] [ID=9] >> 0x3283500: i32 = Register %vreg5 [ID=1] >> 0x3283710: i32 = Constant<3> [ID=2] >> 0x3283e48: i32 = Constant<20> [ID=8] >> In function: fib >> >> As far as I can understand LLVM cannot select it because the pattern is >> not specified. Unfortunately for me, I can't understand how to interpret >> this output. Would anybody be able to help me out? >> > > > The DAG node that has failed selection is "SET_FLAG %vreg5, 3, 20", the > type of the node is "glue" and all 3 arguments are i32. >I understand where SET_FLAG, 3 and 20 come from, but how did you arrive the conclusion that %vreg5 should be part of the pattern?> The top line shows the node that caused the failure. The hex numbers on > that line are the addresses of the arguments. These arguments are then > listed below. > > Newer versions of LLVM show node ids instead of addresses, but AFAIK it > was dependent on some configuration option. > > -Krzysztof > > > -- > Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum, hosted > by The Linux Foundation > _______________________________________________ > LLVM Developers mailing list > llvm-dev at lists.llvm.org > http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev >-- Rail Shafigulin Software Engineer Esencia Technologies -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20160218/e1c5ef4b/attachment-0001.html>
David Chisnall via llvm-dev
2016-Feb-19 12:26 UTC
[llvm-dev] How to interpret Selection DAG error output
On 18 Feb 2016, at 18:43, Rail Shafigulin via llvm-dev <llvm-dev at lists.llvm.org> wrote:> > As far as I can understand LLVM cannot select it because the pattern is not specified. Unfortunately for me, I can't understand how to interpret this output. Would anybody be able to help me out?You’ve had a few answers already, but just to add one more: SelectionDAG has a viewGraph family of methods, that will dump a .dot file and open it with GraphViz. These can be run from the debugger and produce *much* more readable output. When I’m debugging, I generally stick a breakpoint on the code that’s triggering this error and get the pretty picture to try to figure out what’s going on. It’s a lot easier to understand for nontrivial examples. David