<html><head><meta http-equiv="Content-Type" content="text/html; charset=utf-8"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; line-break: after-white-space;" class=""><br class=""><div><br class=""><blockquote type="cite" class=""><div class="">On May 10, 2018, at 8:58 AM, Andrea Di Biagio <<a href="mailto:andrea.dibiagio@gmail.com" class="">andrea.dibiagio@gmail.com</a>> wrote:</div><br class="Apple-interchange-newline"><div class=""><div dir="ltr" class="">Hi all,<br class=""><br class="">The goal of this RFC is to make information related to variant scheduling<br class="">classes accessible at MC level. This would help tools like llvm-mca<br class="">understand/resolve variant scheduling classes.<br class=""><br class="">To achieve this goal, I plan to introduce a new class of scheduling predicates<br class="">named MCSchedPredicate. An MCSchedPredicate allows the definition of boolean<br class="">expressions with a well-known semantic, that can be used to generate code for<br class="">both MachineInstr and MCInst.<br class=""><br class="">The new predicates are designed to be completely optional. Scheduling models<br class="">can use a combination of SchedPredicate and MCSchedPredicate to describe<br class="">variant reads and writes. Old scheduling predicate definitions would still be<br class="">valid. New MCSchedPredicates would behave like normal scheduling predicates.</div></div></blockquote><br class=""><blockquote type="cite" class=""><div class=""><div dir="ltr" class=""><snip><br class=""></div></div></blockquote><br class=""><blockquote type="cite" class=""><div class=""><div dir="ltr" class="">What to do next<br class="">---------------<br class="">I have a series of three patches ready to be sent upstream for review.<br class=""><br class="">The first patch is mostly a no functional change. It introduces the new<br class="">scheduling predicate class in tablegen, and it teaches the<br class="">InstructionInfoEmitter and the SubtargetEmitter how to expand MCSchedPredicate<br class="">definitions.<br class="">The first patch is up for review here: https:://<a href="http://reviews.llvm.org/D46695" class="">reviews.llvm.org/D46695</a>.<br class=""><br class="">The second patch would teach the SubtargetEmitter how to generate method<br class="">resolveVariantSchedClass().<br class=""><br class="">The last patch of the sequence will teach llvm-mca how to use method<br class="">`resolveVariantSchedClass()` to resolve variant classes. llvm-mca will generate an error if the variant scheduling class cannot be resolved.<br class=""><br class="">Review <a href="https://reviews.llvm.org/D46697" class="">https://reviews.llvm.org/D46697</a> is the union of patch1 and patch2 only.<br class="">It is not meant to be reviewed at this stage, since it contains the code<br class="">changes related to patch1.<br class=""><br class="">The third patch is available here: <a href="https://reviews.llvm.org/D46698" class="">https://reviews.llvm.org/D46698</a>.<br class="">D46698 requires patch1 and patch2.<br class=""><br class="">Bonus (optional) patches:<br class=""> 1) [X86] Teach scheduling models how to recognize zero-idioms.<br class="">    This would make easier to review the llvm-mca change.<br class=""> 2) [X86] Add variant scheduling classes for LEA instructions.<br class=""> 3) [AArch64] Rewrite the predicates mentioned by this RFC.<br class=""><br class="">People that are interested in seeing how to implement "optional" patch 3 can<br class="">have a look at the review here: <a href="https://reviews.llvm.org/D46701" class="">https://reviews.llvm.org/D46701</a><br class=""><br class="">Please let me know what you think.<br class=""><br class="">Thanks,<br class="">Andrea<br class=""></div>
</div></blockquote><br class=""></div><div>Fantastic writeup! It’s great to see so much progress on fundamental infrastructure.</div><div><br class=""></div><div>My time for LLVM code review is extremely limited. Can someone work with Andrea to get these patches in?</div><div><br class=""></div><div>-Andy</div><br class=""></body></html>