Hi, after perusing through llc -debug output and stepping through the ARMGenDAGIsel.inc in the debugger, I would greatly like some help in tracking down a failing match to a pattern I specified:<div><br></div><div>First, here is a snippet of a successful match (done in ARM mode)</div>
<div><br></div><div><div><font face="'courier new', monospace">ISEL: Starting pattern match on root node: 0x1e7adf0: i32,ch = load 0x1e4c030, 0x1e78210, 0x1e78310<LD4[ConstantPool]> [ID=10]</font></div><div>
<font face="'courier new', monospace"><br></font></div><div><font face="'courier new', monospace"> Initial Opcode index to 24435</font></div><div><font face="'courier new', monospace">......</font></div>
<div><font face="'courier new', monospace"> Morphed node: 0x1e7adf0: i32,ch = LDRi12 0x1e78210, 0x1e78010, 0x1e7aef0, 0x1e7b0f0, 0x1e4c030<Mem:LD4[ConstantPool]></font></div><div><font face="'courier new', monospace"><br>
</font></div><div><font face="'courier new', monospace">ISEL: Match complete!</font></div><div><font face="'courier new', monospace">ISEL: Starting pattern match on root node: 0x1e78210: i32 = ARMISD::Wrapper 0x1e77f10 [ID=9]</font></div>
<div><font face="'courier new', monospace"><br></font></div><div><font face="'courier new', monospace"> Initial Opcode index to 49796</font></div><div><font face="'courier new', monospace"> OpcodeSwitch from 49799 to 49891</font></div>
<div><font face="'courier new', monospace"> Skipped scope entry (due to false predicate) at index 49896, continuing at 49914</font></div><div><font face="'courier new', monospace"> Morphed node: 0x1e78210: i32 = MOVi32imm 0x1e77f10</font></div>
<div><font face="'courier new', monospace"><br></font></div><div><font face="'courier new', monospace">ISEL: Match complete!</font></div></div><div><br></div><div><br></div><div>Here is the failing case in Thumb2 mode</div>
<div><br></div><div><div><font face="'courier new', monospace">ISEL: Starting pattern match on root node: 0x22f0f10: i32,ch = load 0x22c10b0, 0x22ee330, 0x22ee430<LD4[ConstantPool]> [ID=10]</font></div><div>
<font face="'courier new', monospace"><br></font></div><div><font face="'courier new', monospace"> Initial Opcode index to 24668</font></div><div><font face="'courier new', monospace"> Match failed at index 24684</font></div>
<div><font face="'courier new', monospace">.....</font></div><div><font face="'courier new', monospace"> Continuing at 26993</font></div><div><font face="'courier new', monospace"> Skipped scope entry (due to false predicate) at index 27018, continuing at 27037</font></div>
<div><font face="'courier new', monospace"> Morphed node: 0x22f0f10: i32,ch = t2LDRpci 0x22ee030, 0x22f1010, 0x22f1210, 0x22c10b0<Mem:LD4[ConstantPool]></font></div><div><font face="'courier new', monospace"><br>
</font></div><div><font face="'courier new', monospace">ISEL: Match complete!</font></div></div><div><br></div><div>The logic here (already implemented and working in ARM mode) is to turn all constant island entries into .rodata (i.e. skip constant island pass). </div>
<div>In the thumb2 case, the expected match- ARMISD::Wrapper, which is supposed to morphed to a t2MOVi32imm never happens:</div><div><div>I've placed all the expected patterns to match tconstpool and (hopefully) turned on the correct Requires flag in the ARMInstrThumb2.td in all the places where ARMWrapper tconstpool occurs. </div>
</div><div>However, the expected match does not occur and I am at a loss to explain it.</div><div><br></div><div>I suppose there are several things that could be broken:</div><div><ol><li>There is a bug in the patterns I specified in the .td file</li>
<li>There is some hardcoded glue in ARMInstrThumb2.td that prevents the expected match from happening (perhaps something to do with 'pci' pattern in multiclass T2I_ld ??)</li><li>There is some other glue that prevents the pattern from matching (perhaps in ARMISelLowering - which *does* have custom code..)</li>
</ol></div><div>Assuming that the case is the first or second, what is the best way to associate the table information in ARMGenDAGISel.inc to the entries in the .td file? That is, while stepping through SelectCodeCommon(), I am having a difficult time associating the MatchIndex and the associated MatchTable to the entries in the .td.... Any pointers or help would be greatly appreciated.</div>
<div><br></div><div>Thank you!</div><div>-jason</div><div><br></div><div><br></div>