<div dir="ltr"><div class="gmail_extra"><div class="gmail_quote">On Wed, Nov 18, 2015 at 6:44 AM, Krzysztof Parzyszek 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"><span class="">On 11/17/2015 6:51 PM, Rail Shafigulin via llvm-dev wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
I'm using a Hexagon's packetizer as an example to packetize instructions<br>
for my custom VLIW. The problem that I'm facing is that my target as it<br>
turns out doesn't have all the instructions expanded by the time<br>
packetization happens (for example I have a RET instruction which gets<br>
expanded into a write to a register and a jump/branch). I'm wondering if<br>
Hexagon is experiencing the same issue and how it is solved? And if it<br>
doesn't experience the same what would be the recommendation on solving<br>
this problem? At the moment, my packetization pass is the last one in<br>
MyTargetPassConfig::addPreEmitPass()<br>
</blockquote>
<br></span>
There is a target-independent pass that will try to expand all pseudo instructions after register allocation.  For each instruction, it will check if the instructions is a pseudo-instruction, and if so, it will call the target hook "expandPostRAPseudo" on that instruction.<br>
<br>
Your target will need to implement TargetInstrInfo::expandPostRAPseudo, and mark RET as a pseudo-instruction.<br>
<br>
See lib/CodeGen/ExpandPostRAPseudos.cpp for the expanding pass, and the "expandPostRAPseudo" functions for individual targets to get an idea of how they work.<span class="HOEnZb"><font color="#888888"><br>
<br>
-Krzysztof<br>
<br>
-- <br>
Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum, hosted by The Linux Foundation<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>
</font></span></blockquote></div><div class="gmail_extra"><br></div>I guess I should be more clear by what I mean "expanded". When I say "expanded" I mean the final instruction assembly representation, i.e. all instructions were lowered to their assembly level. Will you recommendation still hold or I should be considering another approach?</div><div class="gmail_extra"><div><br></div>-- <br><div class="gmail_signature"><div dir="ltr"><div><div dir="ltr"><div>R</div></div></div></div></div>
</div></div>