[LLVMdev] request for help writing a register allocator

Lang Hames lhames at gmail.com
Wed Oct 21 18:09:48 PDT 2009


> 1) Some machine instructions have implicit register operands. If you are
> not including these in your calculations you will probably have some errors.
> My apologies for not mentioning this earlier.
>
> You can find the set of implicit uses and defs by querying the
> TargetInstDesc object for each MachineInstr (call MachineInstr::getDesc() to
> get it, and then the TargetInstrDesc::getImplicitUses() and
> TargetInstrDesc::getImplicitDefs() methods to find the regs used/definied by
> this instr).
>

Oops. Seems we copy implicit operands like this into MachineOperands on the
instruction before register allocation. Disregard the above advice - you do
not need to check the TargetInstrDesc implicit operands. You only need to
check the operands returned by MachineInstr::getOperand.


- Lang.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20091021/2d9f49c5/attachment.html>


More information about the llvm-dev mailing list