<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<style type="text/css" style="display:none;"><!-- P {margin-top:0;margin-bottom:0;} --></style>
</head>
<body dir="ltr">
<div id="divtagdefaultwrapper" style="font-size:12pt;color:#000000;font-family:Calibri,Helvetica,sans-serif;" dir="ltr">
<p>Hi All, <br>
</p>
<br>
<p>I faced some problems while using the BuildMI().</p>
<p>Currently, i am trying to replace specific MI with a series of new MI.</p>
<p>I wrote a routine under the processFunctionAfterISel() to detect the targeted MI and replace it accordingly.</p>
<p>After using BuildMI() to perform my replacement, i realize there are unnecessary spilling and reloading of registers in the assembly generated.</p>
<p>By checking the llc debug output, i am suspecting that the virtual register states have been completely messed up.</p>
<p>This is because the spilling and reloading codes are only inserted at the register allocation phase, especially during the state of "Spilling live registers at the end of block".</p>
<p>These spilling and reloading codes are messing up the assembly generated, and the behavior of the code generated is undetermined.
<br>
</p>
<p>I would like to know is there anything i can do to fix the virtual register use-def relationship?</p>
<p>Or is there any standard procedure i should follow to handle the MachineOperands while using BuildMI()?</p>
<p>Any opinions or suggestion are welcomed.<br>
</p>
<p><br>
</p>
<p>Regards,</p>
<p>JC<br>
</p>
</div>
</body>
</html>