[llvm-commits] [PATCH] MachineRegisterInfo: Don't emit the same livein copy more than once

This patch seems to have been lost on the llvm-commits mailing list. Would someone be able to review it?

Thanks,
Tom

Hi Tom,

I’m pretty sure this function should only ever be called once, by SelectionDAG. Do you know where the second call is coming from in your code?

Cheers,
Lang.

Hi Tom,

I'm pretty sure this function should only ever be called once, by
SelectionDAG. Do you know where the second call is coming from in your code?

Cheers,
Lang.

Hi Lang,

I was calling EmitLiveInCopies() from one of my backend specific passes.
If the function can only be called once, then I'll just try to merge
that pass with into the SelectionDAG.

Thanks,
Tom

Hi Tom,

As far as I can tell EmitLiveInCopies is just there to handle physreg arguments and return values. Is there any reason for these to change late in your backend?

  • Lang.

Hi Tom,

As far as I can tell EmitLiveInCopies is just there to handle physreg
arguments and return values. Is there any reason for these to change late
in your backend?

No, on our target (AMD HD2XXX - HD6XXX GPUs) before the program begins,
some values are preloaded into registers. We have special intrinsics
for reading these values (e.g. llvm.R600.read_reg(i32 reg_idx) ), and
we just have a pass that converts these intrinsics to livein registers
and then calls EmitLiveInCopies().

-Tom