From owner-svn-src-projects@FreeBSD.ORG Mon Jul 4 20:39:37 2011 Return-Path: Delivered-To: svn-src-projects@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 20DBE106567C; Mon, 4 Jul 2011 20:39:37 +0000 (UTC) (envelope-from marcel@xcllnt.net) Received: from mail.xcllnt.net (mail.xcllnt.net [70.36.220.4]) by mx1.freebsd.org (Postfix) with ESMTP id DF4F88FC2B; Mon, 4 Jul 2011 20:39:36 +0000 (UTC) Received: from dhcp-192-168-2-22.wifi.xcllnt.net (atm.xcllnt.net [70.36.220.6]) (authenticated bits=0) by mail.xcllnt.net (8.14.5/8.14.5) with ESMTP id p64KdWI0070662 (version=TLSv1/SSLv3 cipher=AES128-SHA bits=128 verify=NO); Mon, 4 Jul 2011 13:39:36 -0700 (PDT) (envelope-from marcel@xcllnt.net) Mime-Version: 1.0 (Apple Message framework v1084) Content-Type: text/plain; charset=us-ascii From: Marcel Moolenaar In-Reply-To: <20110704201028.GA5939@freebsd.org> Date: Mon, 4 Jul 2011 13:39:32 -0700 Content-Transfer-Encoding: quoted-printable Message-Id: <57E084BD-1E76-42F3-8B32-94FB3287F92D@xcllnt.net> References: <201107041951.p64JpQDk032074@svn.freebsd.org> <20110704201028.GA5939@freebsd.org> To: Roman Divacky X-Mailer: Apple Mail (2.1084) Cc: svn-src-projects@freebsd.org, Marcel Moolenaar , src-committers@freebsd.org Subject: Re: svn commit: r223767 - in projects/llvm-ia64: contrib/llvm/lib/Target/IA64 lib/clang/include X-BeenThere: svn-src-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the src " projects" tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 04 Jul 2011 20:39:37 -0000 On Jul 4, 2011, at 1:10 PM, Roman Divacky wrote: > First of all.. big wow :) This is awesome progress. Thanks! >> +void >> +IA64InstrInfo::copyPhysReg(MachineBasicBlock &MBB, >> + MachineBasicBlock::iterator MI, DebugLoc DL, unsigned DestReg, >> + unsigned SrcReg, bool KillSrc) const >> +{ >> + bool GRDest =3D IA64::GRRegClass.contains(DestReg); >> + bool GRSrc =3D IA64::GRRegClass.contains(SrcReg); >> + >> + if (GRDest && GRSrc) { >> + MachineInstrBuilder MIB =3D BuildMI(MBB, MI, DL, get(IA64::ADD), = DestReg); >> + MIB.addReg(IA64::R0); >> + MIB.addReg(SrcReg, getKillRegState(KillSrc)); >> + return; >> + } >> + >> + llvm_unreachable(__func__); >> +} >=20 > 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. On ia64 there's no copy instruction in H/W. The assembler defines "mov r1=3Dr2" as a pseudo-op of "adds r1=3D0,r2". Since I didn't want to introduce an immediate operand yet, I simply used r0, which is hardwired as 0. The result is the same... As for the lowering: the add is eliminated shortly after it's created by virtue of copy elimination, CSE and/or GVN on the selection DAG. We know we can lower ADDs anyway, because it's in the assembly output :-) --=20 Marcel Moolenaar marcel@xcllnt.net