<div dir="ltr">No, this reordering is not possible. Stack coloring is part of codegen. Passes that modify the IR cannot run as part of codegen.<div><br></div><div>Your best bet for enabling tail calls with your meta calling convention is to write a custom pass that rewrites calls in the tail position to use the incoming argument memory instead of a local alloca. It would be up to this custom pass to determine exactly when this is legal.</div></div><div class="gmail_extra"><br><div class="gmail_quote">On Thu, Sep 3, 2015 at 8:57 AM, Nat! 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">Hi<br>
<br>
from what I have figured out, the pass "TailCallElim" is being done in what I would call the "opt" phase of optimization. The "StackColoring" is being done in the "llc" phase. opt -> llc, so TailCallElim is always ahead.<br>
<br>
Now I would like to add something (my reusealloca idea) in "StackColoring" to get rid of some allocas, which inhibit "TailCallElim".<br>
<br>
* Is it possible to rerun (if even possible at that stage) the "TailCallElim" at this stage ?<br>
<br>
* Is it possible to make "StackColoring" into an "opt" pass and try to get it ahead of "TailCallElim" ? I guess not, though I can see how "RegisterColoring" is dependent on architecture, but I don't really see it for allocas.<br>
<br>
Ciao<br>
   Nat!<br>
<br>
P.S. AU.addRequired<TailCallElim>(); would not work BTW.<br>
_______________________________________________<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><br></div>