<div dir="ltr">What is the reason that you need to change the order of instructions? What is the problem that you want to solve?<br><br></div><div class="gmail_extra"><br><div class="gmail_quote">On Wed, Nov 9, 2016 at 7:05 AM, Alex Susu via llvm-dev <span dir="ltr"><<a href="mailto:llvm-dev@lists.llvm.org" target="_blank">llvm-dev@lists.llvm.org</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">  Hello.<br>
    I have tried hard, but in the end I chose a different solution: I change the order of machine instructions by using the ASM writer classes such as [Target]AsmPrinter.cpp. There the code is already scheduled, in a list of instructions and it's very easy to move the instructions in the list.<br>
    (Following Ehsan's advice I looked at <a href="http://llvm.org/docs/doxygen/html/classllvm_1_1GenericScheduler.html" rel="noreferrer" target="_blank">http://llvm.org/docs/doxygen/h<wbr>tml/classllvm_1_1GenericSchedu<wbr>ler.html</a> for example, but I did not get any idea.)<br>
<br>
  Best regards,<br>
    Alex<span class=""><br>
<br>
<br>
On 10/21/2016 5:32 PM, Ehsan Amiri wrote:<br>
</span><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><span class="">
I probably misunderstood the question. You probably want to do this in SelectionDAG.<br>
<br>
On Fri, Oct 21, 2016 at 10:29 AM, Ehsan Amiri <<a href="mailto:ehsanamiri@gmail.com" target="_blank">ehsanamiri@gmail.com</a><br></span><span class="">
<mailto:<a href="mailto:ehsanamiri@gmail.com" target="_blank">ehsanamiri@gmail.com</a>>> wrote:<br>
<br>
    You can do this by changing instruction scheduling heuristics. I think the more<br>
    important question is if this correct always for all platforms.<br>
<br>
    I don't know which scheduler you use. We use GenericScheduler and PostGenericScheduler<br>
    before and after RA. These classes have a ::tryCandidate method which compares two<br>
    instructions that can be legally scheduled and decide which of the two should be<br>
    scheduled. Currently these method are target independent.<br>
<br>
    The correctness question still remains open for me.<br>
<br>
<br>
    On Thu, Oct 20, 2016 at 8:08 PM, Alex Susu via llvm-dev <<a href="mailto:llvm-dev@lists.llvm.org" target="_blank">llvm-dev@lists.llvm.org</a><br></span><span class="">
    <mailto:<a href="mailto:llvm-dev@lists.llvm.org" target="_blank">llvm-dev@lists.llvm.or<wbr>g</a>>> wrote:<br>
<br>
          Hello.<br>
            Is there a way to specify in the back end an (ISD::INLINEASM) SDNode to be<br>
        scheduled first under all circumstances? I need to specify something like node<br>
        priority to schedule the node before all other nodes in the SelectionDAG of the<br>
        basic block.<br>
            (Using chain or glue edges in order to make a node first is not a good idea,<br>
        since I am doing this at instruction selection time, on individual nodes.)<br>
<br>
          Thank you,<br>
            Alex<br>
        ______________________________<wbr>_________________<br>
        LLVM Developers mailing list<br></span>
        <a href="mailto:llvm-dev@lists.llvm.org" target="_blank">llvm-dev@lists.llvm.org</a> <mailto:<a href="mailto:llvm-dev@lists.llvm.org" target="_blank">llvm-dev@lists.llvm.or<wbr>g</a>><br>
        <a href="http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev" rel="noreferrer" target="_blank">http://lists.llvm.org/cgi-bin/<wbr>mailman/listinfo/llvm-dev</a><br>
        <<a href="http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev" rel="noreferrer" target="_blank">http://lists.llvm.org/cgi-bin<wbr>/mailman/listinfo/llvm-dev</a>><br>
<br>
<br>
<br>
</blockquote><div class="HOEnZb"><div class="h5">
______________________________<wbr>_________________<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/<wbr>mailman/listinfo/llvm-dev</a><br>
</div></div></blockquote></div><br></div>