[LLVMdev] problem trying to write an LLVM register-allocation pass

Lang Hames lhames at gmail.com
Thu Nov 15 11:45:15 PST 2012


Hi Susan,

Jakob just pointed me to 'MachineOperand::substPhysReg(unsigned preg, const
TargetRegisterInfo& TRI)'. That substitutes the given physreg for a virtreg
operand, taking the subregister index into account. That is what my
examples have been doing manually. Using substPhysReg would allow you to
tidy the Gcra code up slightly.

- Lang.


On Thu, Nov 15, 2012 at 11:21 AM, Lang Hames <lhames at gmail.com> wrote:

> Thanks Jakob. I should have mentioned that earlier. :)
>
> When you see mismatched sizes on operands it's a fair bet that the subreg
> rewriting has gone wrong. I should have pulled that entirely out of the
> preg search loop in the previous example.
>
> Fixed version attached.
>
> - Lang.
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20121115/a6168fe8/attachment.html>


More information about the llvm-dev mailing list