<div dir="ltr"><br><div class="gmail_extra"><br><div class="gmail_quote">On Tue, Mar 6, 2018 at 5:46 PM, Andrew Trick <span dir="ltr"><<a href="mailto:atrick@apple.com" target="_blank">atrick@apple.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div style="word-wrap:break-word;line-break:after-white-space"><span class=""><br><div><br><blockquote type="cite"><div>On Mar 6, 2018, at 4:20 AM, Andrea Di Biagio <<a href="mailto:andrea.dibiagio@gmail.com" target="_blank">andrea.dibiagio@gmail.com</a>> wrote:</div><br class="m_3583907773807421320Apple-interchange-newline"><div><blockquote class="gmail_quote" style="font-family:Helvetica;font-size:12px;font-style:normal;font-variant-caps:normal;font-weight:normal;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;text-decoration:none;margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-style:solid;border-left-color:rgb(204,204,204);padding-left:1ex"><div style="word-wrap:break-word;line-break:after-white-space"><div><div><div>To be clear then, resolveSchedClass should be moved from TargetSchedModel into MCSchedModel (which is where I originally wanted it). Any TargetInstrInfo APIs called from SchedPredicate should be moved to MCInstrInfo, which should be straightforward but annoying.</div></div></div></div></blockquote><div style="font-family:Helvetica;font-size:12px;font-style:normal;font-variant-caps:normal;font-weight:normal;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;text-decoration:none"><br></div><div class="gmail_quote" style="font-family:Helvetica;font-size:12px;font-style:normal;font-variant-caps:normal;font-weight:normal;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;text-decoration:none">Personally, I don't have a strong opinion on this.<br>My major concern is that not all predicates can be easily rewritten/adapted to work with MCInst and MCschedModel.<br><br>Predicates can potentially access information which is not normally reachable through the MCSchedModel interface. For example, predicate code coud use the TargetInstrInfo interface to obtain extra description for MachineInst objects. This is what happens for ARM targets, where the `PredicateProlog` casts the TargetInstrInfo object to a ARMBaseInstInfo, and predicated use the ARMBaseInstrInfo interface.<br>Some predicates defined by the cortex-a9 scheduling model select the scheduling class "based on the number of memory addresses in the LDM MachineInstr". Emulating that query would require extra knowledge on the machine memory operands, which we don't have when manipulating MCInst objects.</div></div></blockquote><br></div></span><div>I imagine the thing to do is keep a TTI resolveSchedClass that only handles pseudos and call down to MC for everything else. That would allow incremental migration.</div></div></blockquote><div><br>
<div>Thanks for the advice Andy. I will keep looking into it.<br><br></div><div>In the meantime, the patch has got a couple of accepts, and all the review requests have been addressed.<br>
As I mentioned in the phabricator review, <span class="gmail-m_2454808033513810906gmail-transaction-comment">I plan to create bugs for all 
the relevant comments/requests <span class="gmail-m_2454808033513810906gmail-transaction-comment">to keep track of the work on llvm-mca</span>.</span>

<br></div><div>If there are no further objections I am ready to commit the tool.<br><br></div><div>Thanks,<br></div><div>-Andrea</div>

 </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div style="word-wrap:break-word;line-break:after-white-space"><div><br></div><div>I think the LDM predicate is a hack that would be great to fix—the info should all be provided by MC--but admittedly isn’t that straightforward.</div><div><br></div><div>-Andy</div></div></blockquote></div><br></div></div>