[llvm-dev] How to create a proper MachineMemOperand?

Will Lester via llvm-dev llvm-dev at lists.llvm.org
Mon Apr 16 19:49:37 PDT 2018


Thanks for your advice. But I have searched X86 and find no more
information than I have known.
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.
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.
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?

2018-04-16 21:19 GMT+08:00 陳韋任 <chenwj.cs97g at g2.nctu.edu.tw>:

> Usually I will search the target directory, X86 in your case, to see
> how MOV64mr is used with BuildMI to generate the instruction I want.
>
> 2018-04-16 16:25 GMT+08:00 Will Lester via llvm-dev <
> llvm-dev at lists.llvm.org>:
> > Hi all,
> > I met a new problem in the process of my project.
> > I have got an address by mmap. And I want to build a MachineInstr of
> MOV64mr
> > to move a value to the address. But it seems that the MachinePointerInfo
> > needs a pointer to a Value.
> > So can I create a MachineMemOperand directly with the address (is a
> long*) ?
> > Or I need to try some other methods?
> > Thanks a lot,
> > Will
> >
> > _______________________________________________
> > LLVM Developers mailing list
> > llvm-dev at lists.llvm.org
> > http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev
> >
>
>
>
> --
> Wei-Ren Chen (陳韋任)
> Homepage: https://people.cs.nctu.edu.tw/~chenwj
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20180417/60590dd1/attachment.html>


More information about the llvm-dev mailing list