<div><div dir="auto">CopyToReg is not handle by patterns. It should be passed through isel unchanged. It’s part of a special list of ISD opcodes that don’t change in SelectioDAGISel::SelectCodeCommon</div><div dir="auto"><br></div><div dir="auto">It will then be turned into a TargetOpcode::COPY in InstrEmitter::EmitSpecialNode when the DAG is turned into MachineInstrs.</div><div dir="auto"><br></div><div class="gmail_quote"><div>On Sat, Nov 4, 2017 at 7:02 PM Robert Baruch 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:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div>So there's a DAG that looks like this in the debug output:<div><br></div><div><div><font face="monospace">  Selecting: t3: ch,glue = CopyToReg t0, Register:i16 %R5, Constant:i16<127></font></div></div><div><br></div><div>In the instruction selection phase, what pattern would that match? I've constructed this so far:</div><div><br></div><div><font face="monospace">  (??? REG16:$dst, i16imm:$src)</font></div><div><br></div><div>but the problem is, I can't determine what to use as <font face="monospace">???</font>. There is an <font face="monospace">ISD::CopyToReg</font> enum value, but I don't know how that translates to the string to use in the pattern.</div><div><br></div><div>And more generally, how do I find out from a DAG diagram like the ones output by <font face="monospace">-view-isel-dags</font> which node type corresponds to which pattern string?</div><div><br></div><div>Thanks,</div><div><br></div><div>--Rob</div><div><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="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>
</blockquote></div></div><div dir="ltr">-- <br></div><div class="gmail_signature" data-smartmail="gmail_signature">~Craig</div>