<div dir="ltr">Hi, all<br><br>I found a pass at lib/Transforms/Scalar/Sink.cpp which can be used to sinking optimization. But curiously it's not enabled in opt as default and only enabled in AMDGPU backend. Does anyone know the reason?<div><br></div><div>And I have an instruction sequence as following to be sinked. The MachineSink pass and Sink.cpp only handle instructions with 2 successors, how to sink such computing sequence across call?(Because there are much more available registers after call, volatile registers can be used.) <br><br>```<br><pre style="box-sizing:border-box;font-family:SFMono-Regular,Consolas,"Liberation Mono",Menlo,Courier,monospace;font-size:11.9px;margin-bottom:16px;margin-top:0px;background-color:rgb(246,248,250);border-radius:3px;line-height:1.45;overflow:auto;padding:16px;color:rgb(36,41,46)"><code style="box-sizing:border-box;font-family:SFMono-Regular,Consolas,"Liberation Mono",Menlo,Courier,monospace;font-size:11.9px;background:initial;border-radius:3px;margin:0px;padding:0px;border:0px;word-break:normal;display:inline;line-height:inherit;overflow:visible">int g();
int foo(int m) {

        int t = m *3;
        int q = m/3;
        int q1 = m/31;
        int q2 = m/32;
        int q3 = m/33;
        g();

        return t+q+q1+q2+q3;
}</code></pre>```<br clear="all"><div><br></div>-- <br><div dir="ltr" class="gmail_signature" data-smartmail="gmail_signature"><div dir="ltr">Zeson<br></div></div></div></div>