<HTML><BODY style="word-wrap: break-word; -khtml-nbsp-mode: space; -khtml-line-break: after-white-space; "><DIV><DIV>On Sep 7, 2007, at 4:50 PM, <<A href="mailto:Alireza.Moshtaghi@microchip.com">Alireza.Moshtaghi@microchip.com</A>> <<A href="mailto:Alireza.Moshtaghi@microchip.com">Alireza.Moshtaghi@microchip.com</A>> wrote:</DIV><BR class="Apple-interchange-newline"><BLOCKQUOTE type="cite"> <DIV class="Section1"><P class="MsoNormal"><FONT size="2" face="Arial"><SPAN style="font-size:10.0pt; font-family:Arial">I have started to write an llvm backend for one of our microcontrollers (PICxx). I started studying the framework of PowerPc backend of llvm and decided to start by following that framework. Now I have most of the classes and Tblgen files written for a very basic hypothetical microcontroller with very few instructions.</SPAN></FONT></P></DIV></BLOCKQUOTE><DIV><BR class="khtml-block-placeholder"></DIV>Cool!<BR><BLOCKQUOTE type="cite"><DIV class="Section1"><P class="MsoNormal"><FONT size="2" face="Arial"><SPAN style="font-size:10.0pt; font-family:Arial">The project builds and the llc recognizes the new processor, however, when it reaches the point where it wants to lower llvm IR to PICxx DAG, it asserts in LegalizeDAG.cpp in ExpandOp() function after it hits the default case of switch(Node->getOpcode())</SPAN></FONT></P><P class="MsoNormal"><FONT size="2" face="Arial"><SPAN style="font-size:10.0pt; font-family:Arial">Can someone please help me understand how am I ending up in the default case?</SPAN></FONT></P></DIV></BLOCKQUOTE><BR></DIV><DIV>It's hard to say. You'd have to look at what the Node->getOpcode() is. It should be one of the ones that's being handled. It's not, so you need to figure out why it isn't, where it's coming from, and how to get it to be one of the opcodes handled. Check your PICxxISelLowering.cpp (?) file and see what it's doing with that opcode. Are you really going to "expand" it, or should it do something else (legal, promote)?</DIV><DIV><BR class="khtml-block-placeholder"></DIV><DIV>These are a few tips. Others will jump in with better ideas, I'm sure.</DIV><DIV><BR class="khtml-block-placeholder"></DIV><DIV>-bw</DIV><BR></BODY></HTML>