<html><head></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; ">(readding cc llvmdev)<div><br></div><div>On Feb 24, 2012, at 11:46 AM,    محمد ﻋﻤﺮ  ﺩﻫﻠﻮﻯ <<a href="mailto:omerbeg@gmail.com">omerbeg@gmail.com</a>> wrote:</div><div><div><br class="Apple-interchange-newline"><blockquote type="cite"><div class="gmail_quote"><blockquote class="gmail_quote" style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0.8ex; border-left-width: 1px; border-left-color: rgb(204, 204, 204); border-left-style: solid; padding-left: 1ex; position: static; z-index: auto; "><div class="im"><br>
> otherwise how are the machine instructions being accessed/matched for instruction selection ?<br>
><br>
<br>
</div>Have a look at the code in SelectionDAGISel.<br>
<br></blockquote><div><br></div><div>I am looking at the ARM backend.</div><div>In specific, the instruction selection. </div><div>In Select(N), I only see ad-hoc matches on the basis of the opcode in the provided SDNode of the DAG, and then getMachineNode() is being used to generate the machine instruction.</div>
<div>Am I understanding this correctly ?    </div><div><br></div></div></blockquote><div><br></div><div>That's just the target-specific part. Also look in lib/CodeGen/SelectionDAG.</div><div><br></div><div>You may find the debug output from the compiler useful. Try running llc with the "-debug-only=isel" command line option. That will give lots of information about how the selector is going about figuring out which patterns to use.</div><div><br></div><div>-Jim</div><br><blockquote type="cite"><div class="gmail_quote"><div>Consider the following multiply add insstruction, given in ARMInstrInfo.td </div><div><br></div><div><div>def MLA  : AsMul1I32<0b0000001, (outs GPR:$Rd), (ins GPR:$Rn, GPR:$Rm, GPR:$Ra),</div>
<div>                    IIC_iMAC32, "mla", "\t$Rd, $Rn, $Rm, $Ra",</div><div>                   [(set GPR:$Rd, (add (mul GPR:$Rn, GPR:$Rm), GPR:$Ra))]></div></div><div><br></div><div>How do I get this instruction and it corresponding pattern in the selector ?</div>
<div><br></div><div>-Omer </div><div><br></div><div><br></div><div><br></div><div><br></div></div>
</blockquote></div><br></div></body></html>