<div dir="ltr"><p style="margin:0px;font-stretch:normal;line-height:normal;font-family:"Helvetica Neue";color:rgb(69,69,69)">Hi everyone<span style="font-stretch:normal;line-height:normal;font-family:".PingFang TC"">,</span></p>
<p style="margin:0px;font-stretch:normal;line-height:normal;font-family:"Helvetica Neue";color:rgb(69,69,69);min-height:14px"><br></p>
<p style="margin:0px;font-stretch:normal;line-height:normal;font-family:"Helvetica Neue";color:rgb(69,69,69)">I'm quite new to LLVM <i>and doing a  Q-learning  </i><span style="font-stretch:normal;line-height:normal;font-family:".PingFang TC"">(</span><i>just a hobby</i><span style="font-stretch:normal;line-height:normal;font-family:".PingFang TC"">)</span><i> on register allocation for LLVM. RegAllocRL is based on</i></p>
<p style="margin:0px;font-stretch:normal;line-height:normal;font-family:"Helvetica Neue";color:rgb(69,69,69)"><i>RegAllocBase</i><span style="font-stretch:normal;line-height:normal;font-family:".PingFang TC"">,</span><i> RegAllocBasic and add some feature to implement Q-learning algorithm. </i></p>
<p style="margin:0px;font-stretch:normal;line-height:normal;font-family:"Helvetica Neue";color:rgb(69,69,69)"><i>I</i><span style="font-stretch:normal;line-height:normal;font-family:".PingFang TC"">’</span><i>ve currently run as MachineFunctionPass and things seem to work in simple case. In order to make progress on training</i><span style="font-stretch:normal;line-height:normal;font-family:".PingFang TC"">,</span><i> </i></p>
<p style="margin:0px;font-stretch:normal;line-height:normal;font-family:"Helvetica Neue";color:rgb(69,69,69)"><i>I have questions and want to get some help:</i></p>
<p style="margin:0px;font-stretch:normal;line-height:normal;font-family:"Helvetica Neue";color:rgb(69,69,69);min-height:14px"><i></i></p><ol><li style="margin:0px;font-stretch:normal;line-height:normal;font-family:"Helvetica Neue";color:rgb(69,69,69)"><i>Is there any file data format used in LLVM to store information in each compilation step </i><span style="font-stretch:normal;line-height:normal;font-family:".PingFang TC"">?</span><i> As I know</i><span style="font-stretch:normal;line-height:normal;font-family:".PingFang TC"">,</span><i> the Pass can not run several time in one compilation step</i><span style="font-stretch:normal;line-height:normal;font-family:".PingFang TC"">,</span><i> which means that I have to export data to file before compilation step finished and load from it in the next iteration. </i></li><li style="margin:0px;font-stretch:normal;line-height:normal;font-family:"Helvetica Neue";color:rgb(69,69,69)"> For training q-learning parameters<span style="font-stretch:normal;line-height:normal;font-family:".PingFang TC"">,</span> it would be necessary to run reg allocation pass several iterations to converge. Now<span style="font-stretch:normal;line-height:normal;font-family:".PingFang TC"">,</span> I train by compiling the target program once in each iteration and it will cost time. I wonder if I can train by  running the specific reg pass several time to optimize my parameters <span style="font-stretch:normal;line-height:normal;font-family:".PingFang TC"">?</span></li></ol>
<p style="margin:0px;font-stretch:normal;line-height:normal;font-family:"Helvetica Neue";color:rgb(69,69,69);min-height:14px"><br></p>
<p style="margin:0px;font-stretch:normal;line-height:normal;font-family:"Helvetica Neue";color:rgb(69,69,69)">Since I'm new and this project is just experimental <span style="font-stretch:normal;line-height:normal;font-family:".PingFang TC"">,</span> I would appreciate any help and comments. Thanks in advance!</p>
<p style="margin:0px;font-stretch:normal;line-height:normal;font-family:"Helvetica Neue";color:rgb(69,69,69);min-height:14px"><br></p>
<p style="margin:0px;font-stretch:normal;line-height:normal;font-family:"Helvetica Neue";color:rgb(69,69,69)"><a href="https://github.com/Knight-X/llvm/blob/reg_ml/lib/CodeGen/RegAllocRL.h">https://github.com/Knight-X/llvm/blob/reg_ml/lib/CodeGen/RegAllocRL.h</a></p>
<p style="margin:0px;font-stretch:normal;line-height:normal;font-family:"Helvetica Neue";color:rgb(69,69,69);min-height:14px"><br></p>
<p style="margin:0px;font-stretch:normal;line-height:normal;font-family:"Helvetica Neue";color:rgb(69,69,69)">-- </p>
<p style="margin:0px;font-stretch:normal;line-height:normal;font-family:"Helvetica Neue";color:rgb(69,69,69)">Sincerely<span style="font-stretch:normal;line-height:normal;font-family:".PingFang TC"">,</span></p>
<p style="margin:0px;font-stretch:normal;line-height:normal;font-family:"Helvetica Neue";color:rgb(69,69,69)">Tsung-yu Hsieh <span style="font-stretch:normal;line-height:normal;font-family:".PingFang TC"">(</span>Kazami<span style="font-stretch:normal;line-height:normal;font-family:".PingFang TC"">)</span></p>
</div>