<div dir="ltr"><div>I don't think it really went backwards. The "failed at index" uses a cached index not the current index the table is looking at. The index points to the last index that was processed by the opcode decoding switch. I suspect in your case 3259 is the start of an Opc_Scope. An Opc_Scope has multiple children. There's an optimization in Opc_Scope handler to walk each child and see if its even possibly feasible. This avoids pushing the scope stack only to immediately pop it again. This walking of the children and rejecting them prints the "Skipped Scope Entry" messages. Unfortunately, there's no message to indicate when the scope is actually pushed. I suspect in your case all of the children of the Opc_Scope at 3259 were rejected. This would be messages at 3261, 3273, and 3285. So the entire scope fails and prints the "Match failed at index 3259" since that's where the Opc_Scope it was processing started. 3305 should be the end marker for the scope. Then the stack pops which prints the continuing at 3306 message.</div><div><br></div><div>Are you able to share your XXXGenDAGISel.inc?</div><div><br></div><div><div dir="ltr" class="gmail_signature" data-smartmail="gmail_signature">~Craig</div></div><br></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Sat, Feb 9, 2019 at 12:35 PM Josh Sharp via llvm-dev <<a href="mailto:llvm-dev@lists.llvm.org">llvm-dev@lists.llvm.org</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">




<div dir="ltr">
<div style="font-family:Calibri,Helvetica,sans-serif;font-size:12pt;color:rgb(0,0,0)">
Hi,</div>
<div style="font-family:Calibri,Helvetica,sans-serif;font-size:12pt;color:rgb(0,0,0)">
I'd like to understand the order in which patterns are searched during ISEL. In the example below, indices are searched in ascending order from 808 to 3305, then it goes back to 3259 and eventually it matches the wrong instruction. Why did go back from 3305
 to 3259? In my XXXGenDAGISel.inc, I can see that the correct instruction is at index 3420 but it never got there.<br>
</div>
<div style="font-family:Calibri,Helvetica,sans-serif;font-size:12pt;color:rgb(0,0,0)">
<br>
</div>
<div style="font-family:Calibri,Helvetica,sans-serif;font-size:12pt;color:rgb(0,0,0)">
<span>ISEL: Starting pattern match<br>
</span>
<div>  Skipped scope entry (due to false predicate) at index 3, continuing at 808<br>
</div>
<div>  Skipped scope entry (due to false predicate) at index 809, continuing at 865<br>
</div>
<div>  Skipped scope entry (due to false predicate) at index 867, continuing at 1091<br>
</div>
<div>  Skipped scope entry (due to false predicate) at index 1093, continuing at 1578<br>
</div>
<div>  Skipped scope entry (due to false predicate) at index 1579, continuing at 1605<br>
</div>
<div>  Skipped scope entry (due to false predicate) at index 1606, continuing at 1668<br>
</div>
<div>  Skipped scope entry (due to false predicate) at index 1670, continuing at 2369<br>
</div>
<div>  Skipped scope entry (due to false predicate) at index 2370, continuing at 2397<br>
</div>
<div>  Skipped scope entry (due to false predicate) at index 2398, continuing at 2451<br>
</div>
<div>  Skipped scope entry (due to false predicate) at index 2452, continuing at 2562<br>
</div>
<div>  Skipped scope entry (due to false predicate) at index 2563, continuing at 2641<br>
</div>
<div>  Skipped scope entry (due to false predicate) at index 2642, continuing at 2669<br>
</div>
<div>  Skipped scope entry (due to false predicate) at index 2670, continuing at 2696<br>
</div>
<div>  Skipped scope entry (due to false predicate) at index 2697, continuing at 2779<br>
</div>
<div>  Skipped scope entry (due to false predicate) at index 2780, continuing at 2835<br>
</div>
<div>  Skipped scope entry (due to false predicate) at index 2836, continuing at 2891<br>
</div>
<div>  Skipped scope entry (due to false predicate) at index 2892, continuing at 2947<br>
</div>
<div>  Skipped scope entry (due to false predicate) at index 2948, continuing at 2999<br>
</div>
<div>  Skipped scope entry (due to false predicate) at index 3000, continuing at 3032<br>
</div>
<div>  Skipped scope entry (due to false predicate) at index 3033, continuing at 3053<br>
</div>
<div>  Skipped scope entry (due to false predicate) at index 3054, continuing at 3085<br>
</div>
<div>  Skipped scope entry (due to false predicate) at index 3086, continuing at 3114<br>
</div>
<div>  Skipped scope entry (due to false predicate) at index 3115, continuing at 3171<br>
</div>
<div>  Skipped scope entry (due to false predicate) at index 3172, continuing at 3201<br>
</div>
<div>  Skipped scope entry (due to false predicate) at index 3202, continuing at 3253<br>
</div>
<div>  Skipped scope entry (due to false predicate) at index 3261, continuing at 3272<br>
</div>
<div>  Skipped scope entry (due to false predicate) at index 3273, continuing at 3284<br>
</div>
<div>  Skipped scope entry (due to false predicate) at index 3285, continuing at 3305<br>
</div>
<div>  Match failed at index 3259<br>
</div>
<div>  Continuing at 3306<br>
</div>
<div>  Match failed at index 3307<br>
</div>
<div>  Continuing at 3327<br>
</div>
<div>  Match failed at index 3328<br>
</div>
<div>  Continuing at 3361<br>
</div>
<div>  Morphed node: t17: i32 = MOVRR t17<br>
</div>
<div>ISEL: Match complete!<br>
</div>
<span></span></div>
<div style="font-family:Calibri,Helvetica,sans-serif;font-size:12pt;color:rgb(0,0,0)">
<br>
</div>
<div style="font-family:Calibri,Helvetica,sans-serif;font-size:12pt;color:rgb(0,0,0)">
<br>
</div>
<div style="font-family:Calibri,Helvetica,sans-serif;font-size:12pt;color:rgb(0,0,0)">
Thanks.<br>
</div>
</div>

_______________________________________________<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="https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev" rel="noreferrer" target="_blank">https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev</a><br>
</blockquote></div>