<div dir="ltr"><div><div><div>Thanks for your advice. But I have searched X86 and find no more information than I have known. <br></div>The problem is not to create a MachineMemOperand, but to create a MachineMemOperand with certain address. This scene does not exist in the original code. <br></div>Since I have to do this in the process of register allocating, inserting IR instruction seems to be infeasible. I have thought of storing the address in a global variable in the IR, and loading it afterwards. But it seems to be improper as mentioned before. <br></div>May I do not create a MachineMemOperand, just store the address in a register, and use some MachineInstr to store the value to the address? <br></div><div class="gmail_extra"><br><div class="gmail_quote">2018-04-16 21:19 GMT+08:00 陳韋任 <span dir="ltr"><<a href="mailto:chenwj.cs97g@g2.nctu.edu.tw" target="_blank">chenwj.cs97g@g2.nctu.edu.tw</a>></span>:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Usually I will search the target directory, X86 in your case, to see<br>
how MOV64mr is used with BuildMI to generate the instruction I want.<br>
<div><div class="h5"><br>
2018-04-16 16:25 GMT+08:00 Will Lester via llvm-dev <<a href="mailto:llvm-dev@lists.llvm.org">llvm-dev@lists.llvm.org</a>>:<br>
> Hi all,<br>
> I met a new problem in the process of my project.<br>
> I have got an address by mmap. And I want to build a MachineInstr of MOV64mr<br>
> to move a value to the address. But it seems that the MachinePointerInfo<br>
> needs a pointer to a Value.<br>
> So can I create a MachineMemOperand directly with the address (is a long*) ?<br>
> Or I need to try some other methods?<br>
> Thanks a lot,<br>
> Will<br>
><br>
</div></div>> ______________________________<wbr>_________________<br>
> LLVM Developers mailing list<br>
> <a href="mailto:llvm-dev@lists.llvm.org">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/<wbr>mailman/listinfo/llvm-dev</a><br>
><br>
<span class="HOEnZb"><font color="#888888"><br>
<br>
<br>
-- <br>
Wei-Ren Chen (陳韋任)<br>
Homepage: <a href="https://people.cs.nctu.edu.tw/~chenwj" rel="noreferrer" target="_blank">https://people.cs.nctu.edu.tw/<wbr>~chenwj</a><br>
</font></span></blockquote></div><br></div>