svn commit: r223767 - in projects/llvm-ia64: contrib/llvm/lib/Target/IA64 lib/clang/include

Roman Divacky rdivacky at freebsd.org
Mon Jul 4 20:10:30 UTC 2011


First of all.. big wow :) This is awesome progress.

On Mon, Jul 04, 2011 at 07:51:26PM +0000, Marcel Moolenaar wrote:
> Author: marcel
> Date: Mon Jul  4 19:51:26 2011
> New Revision: 223767
> URL: http://svn.freebsd.org/changeset/base/223767
> 
> Log:
>   o  Implement LowerFormalArguments() LowerReturn() using CallingConv and
>      for general registers only.
>   o  Implement IA64InstrInfo::copyPhysReg() for general registers. This
>      is needed during lowering and before copy elimination.

This seems wrong. See below.

> +void
> +IA64InstrInfo::copyPhysReg(MachineBasicBlock &MBB,
> +    MachineBasicBlock::iterator MI, DebugLoc DL, unsigned DestReg,
> +    unsigned SrcReg, bool KillSrc) const
> +{
> +  bool GRDest = IA64::GRRegClass.contains(DestReg);
> +  bool GRSrc  = IA64::GRRegClass.contains(SrcReg);
> +
> +  if (GRDest && GRSrc) {
> +    MachineInstrBuilder MIB = BuildMI(MBB, MI, DL, get(IA64::ADD), DestReg);
> +    MIB.addReg(IA64::R0);
> +    MIB.addReg(SrcReg, getKillRegState(KillSrc));
> +    return;
> +  }
> +
> +  llvm_unreachable(__func__);
> +}

copyPhysReg() done via ADD ? Is this just some temporary measure to achieve
emission of any code? I am not even sure how this can work. The IR should
require you to lower the ISD::ADD node, right? You don't seem to be doing that.

Anyway, pretty good progress - seems like you're getting grasp of LLVM very
fast!

roman


More information about the svn-src-projects mailing list