[LLVMdev] Replacing a Reg MachineOperand with a non-Reg MachineOperand?

Tom Stellard tom at stellard.net
Tue Jun 16 06:57:17 PDT 2015


On Mon, Jun 15, 2015 at 10:16:47PM -0400, Ryan Taylor wrote:
> I have a MachineOperand that could be something other than a Reg: mem,
> global address, imm, etc...
> 
> I want to replace a reg MachineOperand with this non-reg MachineOperand.
> 
> I've tried a few different things, but it doesn't seem like there is some
> simple functionality to do this?
> 
> "RemoveOperand" and "addOperand" does not work.
> There doesn't seem to be a valid "ChangeTo..." function for this.
> 
> 

What type of operand do you want to change it to?  If there is no
"ChangeTo..." function for the new type, I think the best thing to do
would be to add a new "ChangeTo..." function to handle the new type.

-Tom

> What's the best way to do this without tearing down the instructions and
> using BuildMI?
> 
> Thanks.

> _______________________________________________
> LLVM Developers mailing list
> LLVMdev at cs.uiuc.edu         http://llvm.cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev




More information about the llvm-dev mailing list