<div dir="ltr"><br><div class="gmail_extra"><br><div class="gmail_quote">On Fri, Feb 19, 2016 at 6:10 AM, Krzysztof Parzyszek via llvm-dev <span dir="ltr"><<a href="mailto:llvm-dev@lists.llvm.org" target="_blank">llvm-dev@lists.llvm.org</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><span class="">On 2/18/2016 6:01 PM, Rail Shafigulin via llvm-dev wrote:<br>
<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
            [(set SR:$rD, (Esenciasetflag (i32 GPR:$rA), (i32<br>
immSExt16:$imm), (i32 Cond)))]> {<br>
</blockquote>
<br></span>
I suspect that the "set SR:$rD" is the problem here.  The Esenciasetflag does not have any values that can be assigned to a<br>
register, so it's probably this part that causes the pattern to fail.<br>
<br>
<br>
Tablegen creates a xxxGenDAGISel.inc file in your target's build directory. The "index" numbers that the debugging info shows correspond to the numbers in that file.  Here's an example from HexagonGenDAGISel.inc:<br>
<br>
/*28*/              OPC_Scope, 88|128,3/*472*/, /*->503*/ // 3 children in Scope<br>
/*31*/                OPC_MoveChild, 1,<br>
/*33*/                OPC_CheckOpcode, TARGET_VAL(ISD::ADD),<br>
/*36*/                OPC_RecordChild0, // #2 = $base<br>
/*37*/                OPC_RecordChild1, // #3 = $offset<br>
/*38*/                OPC_MoveChild, 1,<br>
/*40*/                OPC_CheckOpcode, TARGET_VAL(ISD::Constant),<br>
/*43*/                OPC_Scope, 65, /*->110*/ // 7 children in Scope<br>
/*45*/                  OPC_CheckPredicate, 0, // Predicate_u32ImmPred<br>
/*47*/                  OPC_MoveParent,<br>
/*48*/                  OPC_CheckType, MVT::i32,<br>
<br>
When the matcher says "false predicate at index 123", you can look at the line marked with /*123*/ and see exactly what predicate it was checking.  This helps immensely with solving such problems.<span class=""><font color="#888888"><br>
<br>
<br>
-Krzysztof<br>
<br>
-- <br>
Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum, hosted by The Linux Foundation<br>
_______________________________________________<br>
LLVM Developers mailing list<br>
<a href="mailto:llvm-dev@lists.llvm.org" target="_blank">llvm-dev@lists.llvm.org</a><br>
<a href="http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev" rel="noreferrer" target="_blank">http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev</a><br>
</font></span></blockquote></div><br></div><div class="gmail_extra">I'm having difficulty interpreting the EsenciaGenDAGISel.inc. Specifically the MatcherTable. I would really appreciate any help on this. Say we are looking at the following code:<br><br>/*254*/     /*SwitchOpcode*/ 42|128,4/*554*/, TARGET_VAL(EsenciaISD::SET_FLAG),// ->812<br>/*258*/       OPC_RecordChild0, // #0 = $rA<br>/*259*/       OPC_Scope, 99|128,2/*355*/, /*->617*/ // 2 children in Scope<br>/*262*/         OPC_CheckChild0Type, MVT::i32,<br>/*264*/         OPC_RecordChild1, // #1 = $imm<br>/*265*/         OPC_Scope, 59|128,1/*187*/, /*->455*/ // 2 children in Scope<br>/*268*/           OPC_MoveChild, 1,<br>/*270*/           OPC_CheckOpcode, TARGET_VAL(ISD::Constant),<br>/*273*/           OPC_CheckPredicate, 16, // Predicate_immSExt16<br>/*275*/           OPC_MoveParent,<br>/*276*/           OPC_MoveChild, 2,<br>/*278*/           OPC_CheckOpcode, TARGET_VAL(ISD::Constant),<br>/*281*/           OPC_CheckType, MVT::i32,<br>/*283*/           OPC_Scope, 16, /*->301*/ // 10 children in Scope<br>/*285*/             OPC_CheckPredicate, 17, // Predicate_Esencia_CC_EQ<br>/*287*/             OPC_MoveParent,<br>/*288*/             OPC_CheckType, MVT::i32,<br>/*290*/             OPC_EmitConvertToTarget, 1,<br>/*292*/             OPC_MorphNodeTo, TARGET_VAL(Esencia::SFEQ_ri), 0|OPFL_GlueOutput,<br>                        1/*#VTs*/, MVT::i32, 2/*#Ops*/, 0, 2, <br>                    // Src: (Esenciasetflag:i32 GPR:i32:$rA, (imm:i32)<<P:Predicate_immSExt16>>:$imm, (imm:i32)<<P:Predicate_Esencia_CC_EQ>>) - Complexity = 11<br>                    // Dst: (SFEQ_ri:i32 GPR:i32:$rA, (imm:i32):$imm)<br>/*301*/           /*Scope*/ 16, /*->318*/<br>/*302*/             OPC_CheckPredicate, 18, // Predicate_Esencia_CC_NE<br>/*304*/             OPC_MoveParent,<br>/*305*/             OPC_CheckType, MVT::i32,<br>/*307*/             OPC_EmitConvertToTarget, 1,<br>/*309*/             OPC_MorphNodeTo, TARGET_VAL(Esencia::SFNE_ri), 0|OPFL_GlueOutput,<br>                        1/*#VTs*/, MVT::i32, 2/*#Ops*/, 0, 2, <br>                    // Src: (Esenciasetflag:i32 GPR:i32:$rA, (imm:i32)<<P:Predicate_immSExt16>>:$imm, (imm:i32)<<P:Predicate_Esencia_CC_NE>>) - Complexity = 11<br>                    // Dst: (SFNE_ri:i32 GPR:i32:$rA, (imm:i32):$imm)<br>/*318*/           /*Scope*/ 16, /*->335*/<br>/*319*/             OPC_CheckPredicate, 19, // Predicate_Esencia_CC_GTU<br>/*321*/             OPC_MoveParent,<br>/*322*/             OPC_CheckType, MVT::i32,<br>/*324*/             OPC_EmitConvertToTarget, 1,<br><br></div><div class="gmail_extra">what does it tell me? How do I interpret it? <br><br></div><div class="gmail_extra">I also have a question about predicates. What exactly are they? I know that they are pattern leaves and have code associated with them. But how exactly do they fit into the pattern matching?<br><br></div><div class="gmail_extra">Any help on this is appreciated.<br></div><div class="gmail_extra"><br clear="all"></div><div class="gmail_extra"><br>-- <br><div class="gmail_signature"><div dir="ltr"><div><div dir="ltr"><div>Rail Shafigulin<br></div>Software Engineer <br>Esencia Technologies<br></div></div></div></div>
</div></div>